CancellationToken
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. |
bool get_CanBeCanceled() const | Gets whether this token is capable of being in the canceled state. |
bool get_IsCancellationRequested() const | Gets whether cancellation has been requested for this token. |
static CancellationToken get_None() | Returns an empty System::Threading::CancellationToken value. |
CancellationTokenRegistration Register(const Action<>&) const | Registers a callback that will be invoked when cancellation is requested. |
void 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.Slides