System::Threading::CancellationToken::ThrowIfCancellationRequested 方法

CancellationToken::ThrowIfCancellationRequested method

如果已请求取消,则抛出 OperationCanceledException。

void System::Threading::CancellationToken::ThrowIfCancellationRequested() const

备注

此方法提供了一种便捷方式,可在代码中安全抛出异常的特定位置检查是否已取消。

另见