.NET Framework Class Library |
ManualResetEventSlim..::.Wait Method (CancellationToken) |
ManualResetEventSlim Class See Also Send Feedback |
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
Exception | Condition |
---|---|
System..::.InvalidOperationException | The maximum number of waiters has been exceeded. |
OperationCanceledExcepton | cancellationToken was canceled. |