Class AsyncLock
- Namespace
- SixLabors.ImageSharp.Web.Synchronization
- Assembly
- SixLabors.ImageSharp.Web.dll
An asynchronous locker that uses an IDisposable pattern for releasing the lock.
public sealed class AsyncLock : IDisposable
- Inheritance
-
AsyncLock
- Implements
- Inherited Members
Constructors
AsyncLock()
Initializes a new instance of the AsyncLock class.
public AsyncLock()
Properties
OnRelease
Gets or sets the callback that should be invoked whenever this lock is released.
public Action? OnRelease { get; set; }
Property Value
Methods
Dispose()
Releases all resources used by the current instance of the AsyncLock class.
public void Dispose()
LockAsync()
Asynchronously obtains the lock. Dispose the returned IDisposable to release the lock.
public Task<IDisposable> LockAsync()
Returns
- Task<IDisposable>
The IDisposable that will release the lock.