Signals to a CancellationToken that it should be canceled.
Namespace:
System.Threading
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
<ComVisibleAttribute(False)> _ <HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization := True, _ ExternalThreading := True)> _ Public NotInheritable Class CancellationTokenSource _ Implements IDisposable |
C# |
---|
[ComVisibleAttribute(false)] [HostProtectionAttribute(SecurityAction.LinkDemand, Synchronization = true, ExternalThreading = true)] public sealed class CancellationTokenSource : IDisposable |
Remarks
CancellationTokenSource is used to instantiate a CancellationToken (via the source's Token property) that can be handed to operations that wish to be notified of cancellation or that can be used to register asynchronous operations for cancellation. That token may have cancellation requested by calling to the source's Cancel method.
All members of this class, except Dispose, are thread-safe and may be used concurrently from multiple threads.
Inheritance Hierarchy
System..::.Object
System.Threading..::.CancellationTokenSource
System.Threading..::.CancellationTokenSource