System::Threading::CancellationToken class
Contents
[
Hide
]CancellationToken class
Propagates notification that operations should be canceled. This class provides a mechanism for cooperative cancellation between threads, allowing one thread to notify others that an operation should be canceled.
class CancellationToken : public System::Details::BoxableObjectBase
Methods
Method | Description |
---|---|
CancellationToken() | Default constructor. |
get_CanBeCanceled() const | Gets whether this token is capable of being in the canceled state. |
get_IsCancellationRequested() const | Gets whether cancellation has been requested for this token. |
static get_None() | Returns an empty System::Threading::CancellationToken value. |
Register(const Action<>&) const | Registers a callback that will be invoked when cancellation is requested. |
ThrowIfCancellationRequested() const | Throws a OperationCanceledException if cancellation has been requested. |
Remarks
A CancellationToken can only be canceled through its associated CancellationTokenSource.
See Also
- Namespace System::Threading
- Library Aspose.PDF for C++