IOT Dash
Classes | Static Public Member Functions | List of all members
IotDash.Utils.Threading.ThreadingExtensions Class Reference

Static Public Member Functions

static async Task< IDisposable > LockAsync (this SemaphoreSlim semaphore)
 

Detailed Description

Extensions for SemaphoreSlim synchronisation primitive allowing nice syntax with the using (...) pattern.

Member Function Documentation

◆ LockAsync()

static async Task< IDisposable > IotDash.Utils.Threading.ThreadingExtensions.LockAsync ( this SemaphoreSlim  semaphore)
inlinestatic

Internally does SemaphoreSlim.WaitAsync() and returns a semaphore guard.

Parameters
semaphoreThe semaphore.
Returns
An IDisposable object, that when disposed releases the semaphore.

The documentation for this class was generated from the following file: