Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

CancellationToken.WaitHandle Property

Definition

Namespace:
System.Threading
Assemblies:
mscorlib.dll, System.Threading.Tasks.dll
Assemblies:
netstandard.dll, System.Runtime.dll
Assembly:
System.Threading.Tasks.dll
Assembly:
System.Runtime.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Source:
CancellationToken.cs
Source:
CancellationToken.cs
Source:
CancellationToken.cs
Source:
CancellationToken.cs
Source:
CancellationToken.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets a WaitHandle that is signaled when the token is canceled.

public:
 property System::Threading::WaitHandle ^ WaitHandle { System::Threading::WaitHandle ^ get(); };
public System.Threading.WaitHandle WaitHandle { get; }
member this.WaitHandle : System.Threading.WaitHandle
Public ReadOnly Property WaitHandle As WaitHandle

Property Value

A WaitHandle that is signaled when the token is canceled.

Exceptions

The associated CancellationTokenSource has been disposed.

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.

Applies to

See also


Feedback

Was this page helpful?