CancellationToken Property

Task Parallel System.Threading

Gets or sets the CancellationToken associated with this ParallelOptions instance.

Namespace:  System.Threading.Tasks
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Property CancellationToken As CancellationToken
C#
public CancellationToken CancellationToken { get; set; }

Remarks

Providing a CancellationToken to a Parallel method enables the operation to be exited early. Code external to the operation may cancel the token, and if the operation observes the token being set, it may exit early by throwing an OperationCanceledException.

See Also