WaitHandle Property

Task Parallel System.Threading

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

ExceptionCondition
System..::.ObjectDisposedExceptionThe associated CancellationTokenSource has been disposed.

See Also