System::Threading::CancellationTokenSource class

CancellationTokenSource class

A cancellation token source that can be used to trigger cancellation notifications.

class CancellationTokenSource : public System::IDisposable

Methods

MethodDescription
Cancel()Communicates a request for cancellation.
CancellationTokenSource()Constructs a new CancellationTokenSource.
static CreateLinkedTokenSource(const CancellationToken&, const CancellationToken&)Creates a linked token source that cancels when any of the provided tokens cancel.
Dispose() overrideReleases all resources used by the CancellationTokenSource.
get_IsCancellationRequested() constGets whether cancellation has been requested.
get_Token() constGets the cancellation token associated with this source.

Remarks

Provides mechanisms to create and control cancellation tokens for cooperative cancellation of operations.

See Also