Class SemaphoreSlimExt
Provides disposable lock scopes for SemaphoreSlim.
public static class SemaphoreSlimExt
- Inheritance
-
SemaphoreSlimExt
- Inherited Members
Methods
Lock(SemaphoreSlim)
Waits for the semaphore and returns a scope that releases it when disposed.
public static IDisposable Lock(this SemaphoreSlim semaphore)
Parameters
semaphoreSemaphoreSlim
Returns
LockAsync(SemaphoreSlim)
Asynchronously waits for the semaphore and returns a scope that releases it when disposed.
public static Task<IDisposable> LockAsync(this SemaphoreSlim semaphore)
Parameters
semaphoreSemaphoreSlim