Class AsyncLock
An asynchronous locker that uses an IDisposable pattern for releasing the lock.
Namespace: SixLabors.ImageSharp.Web.Synchronization
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public sealed class AsyncLock : IDisposable
Constructors
| Improve this Doc View SourceAsyncLock()
Initializes a new instance of the AsyncLock class.
Declaration
public AsyncLock()
Properties
| Improve this Doc View SourceOnRelease
Gets or sets the callback that should be invoked whenever this lock is released.
Declaration
public Action? OnRelease { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Action> |
Methods
| Improve this Doc View SourceDispose()
Releases all resources used by the current instance of the AsyncLock class.
Declaration
public void Dispose()
LockAsync()
Asynchronously obtains the lock. Dispose the returned
Declaration
public Task<IDisposable> LockAsync()
Returns
Type | Description |
---|---|
Task<IDisposable> | The |