Wait Method (CancellationToken)

Task Parallel System.Threading

Blocks the current thread until the current ManualResetEventSlim receives a signal, 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 to observe.

Remarks

The caller of this method blocks indefinitely until the current instance is set. The caller will return immediately if the event is currently in a set state.

Exceptions

ExceptionCondition
System..::.InvalidOperationException The maximum number of waiters has been exceeded.
OperationCanceledExceptoncancellationToken was canceled.

See Also