.NET Framework Class Library |
CancellationToken..::.WaitHandle Property |
CancellationToken Structure See Also Send Feedback |
Gets a WaitHandle that is signaled when the token is canceled.
Namespace:
System.Threading
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public ReadOnly Property WaitHandle As WaitHandle |
C# |
---|
public WaitHandle WaitHandle { get; } |
Remarks
Accessing this property causes a WaitHandle
to be instantiated. It is preferable to only use this property when necessary, and to then
dispose the associated CancellationTokenSource instance at the earliest opportunity (disposing
the source will dispose of this allocated handle). The handle should not be closed or disposed directly.
Exceptions
Exception | Condition |
---|---|
System..::.ObjectDisposedException | The associated CancellationTokenSource has been disposed. |