SemaphoreSlim.WaitAsync Method (CancellationToken)

May 11, 2014

Asynchronously waits to enter the SemaphoreSlim, while observing a CancellationToken.

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

'Declaration
Public Function WaitAsync ( _
	cancellationToken As CancellationToken _
) As Task

Parameters

cancellationToken
Type: System.Threading.CancellationToken
The CancellationToken token to observe.

Return Value

Type: System.Threading.Tasks.Task
A task that will complete when the semaphore has been entered.

ExceptionCondition
ObjectDisposedException

The current instance has already been disposed.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2014 Microsoft