SemaphoreSlim.WaitAsync Method (CancellationToken)

July 28, 2014

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

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

public Task WaitAsync(
	CancellationToken cancellationToken
)

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