Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SemaphoreSlim.WaitAsync Method (CancellationToken)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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: