AvailableWaitHandle Property

Task Parallel System.Threading

Returns a WaitHandle that can be used to wait on the semaphore.

Namespace:  System.Threading
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public ReadOnly Property AvailableWaitHandle As WaitHandle
C#
public WaitHandle AvailableWaitHandle { get; }

Field Value

A WaitHandle that can be used to wait on the semaphore.

Remarks

A successful wait on the AvailableWaitHandle does not imply a successful wait on the SemaphoreSlim itself, nor does it decrement the semaphore's count. AvailableWaitHandle exists to allow a thread to block waiting on multiple semaphores, but such a wait should be followed by a true wait on the target semaphore.

Exceptions

ExceptionCondition
System..::.ObjectDisposedExceptionThe SemaphoreSlim has been disposed.

See Also