CancellationToken.WaitHandle CancellationToken.WaitHandle CancellationToken.WaitHandle CancellationToken.WaitHandle Property

定义

获取在取消标记时收到信号的 WaitHandleGets 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

属性值

在取消标记时收到信号的 WaitHandleA WaitHandle that is signaled when the token is canceled.

异常

注解

访问此属性会导致WaitHandle要实例化。Accessing this property causes a WaitHandle to be instantiated. 最好仅使用此属性,如有必要,,然后释放关联CancellationTokenSource尽早 (disposing 源将释放此分配的句柄) 的实例。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.

适用于

另请参阅