Struct AsyncLock.Releaser
- Namespace
- CryptoHives.Foundation.Threading.Async.Pooled
- Assembly
- CryptoHives.Foundation.Threading.dll
A small value type returned by awaiting a lock acquisition. Disposing the releaser releases the lock.
public readonly struct AsyncLock.Releaser : IDisposable, IAsyncDisposable, IEquatable<AsyncLock.Releaser>
- Implements
- Inherited Members
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
public ValueTask DisposeAsync()
Returns
Equals(Releaser)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(AsyncLock.Releaser other)
Parameters
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Operators
operator ==(Releaser, Releaser)
Determines whether two AsyncLock.Releaser instances are equal.
public static bool operator ==(AsyncLock.Releaser left, AsyncLock.Releaser right)
Parameters
leftAsyncLock.ReleaserThe first Releaser to compare.
rightAsyncLock.ReleaserThe second Releaser to compare.
Returns
- bool
true if the specified Releaser instances are equal; otherwise, false.
operator !=(Releaser, Releaser)
Determines whether two AsyncLock.Releaser instances are not equal.
public static bool operator !=(AsyncLock.Releaser left, AsyncLock.Releaser right)
Parameters
leftAsyncLock.ReleaserThe first Releaser to compare.
rightAsyncLock.ReleaserThe second Releaser to compare.
Returns
- bool
false if the specified Releaser instances are equal; otherwise, true.