18 public static async Task<SemaphoreSlimContext>
Lock(SemaphoreSlim semaphore, CancellationToken cancellationToken)
readonly SemaphoreSlim lockedSemaphore
The locked SemaphoreSlim
SemaphoreSlimContext(SemaphoreSlim lockedSemaphore)
Construct a SemaphoreSlimContext
bool disposed
If Dispose has been called
void Dispose()
Release the lock on lockedSemaphore
readonly object disposeLock
object for disposed.
static async Task< SemaphoreSlimContext > Lock(SemaphoreSlim semaphore, CancellationToken cancellationToken)
Asyncronously locks a semaphore
Async lock context helper