Wait Method (CancellationToken)

Task Parallel System.Threading

Blocks the current thread until it can enter the SemaphoreSlim, while observing a CancellationToken.

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

Syntax

Visual Basic (Declaration)
Public Sub Wait ( _
	cancellationToken As CancellationToken _
)
C#
public void Wait(
	CancellationToken cancellationToken
)

Parameters

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

Exceptions

ExceptionCondition
System..::.OperationCanceledExceptioncancellationToken was canceled.
System..::.ObjectDisposedExceptionThe current instance has already been disposed.

See Also