.NET Framework Class Library |
SemaphoreSlim..::.Wait Method (CancellationToken) |
SemaphoreSlim Class See Also Send Feedback |
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
Exception | Condition |
---|---|
System..::.OperationCanceledException | cancellationToken was canceled. |
System..::.ObjectDisposedException | The current instance has already been disposed. |