|
static async Task< IDisposable > | LockAsync (this SemaphoreSlim semaphore) |
|
Extensions for SemaphoreSlim synchronisation primitive allowing nice syntax with the using (...)
pattern.
◆ LockAsync()
static async Task< IDisposable > IotDash.Utils.Threading.ThreadingExtensions.LockAsync |
( |
this SemaphoreSlim |
semaphore | ) |
|
|
inlinestatic |
Internally does SemaphoreSlim.WaitAsync() and returns a semaphore guard.
- Parameters
-
- Returns
- An IDisposable object, that when disposed releases the semaphore.
The documentation for this class was generated from the following file:
- Utilities/ThreadingExtensions.cs