ParallelOptions::CancellationToken Property

.NET Framework (current version)
 

Gets or sets the CancellationToken associated with this ParallelOptions instance.

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

public:
property CancellationToken CancellationToken {
	CancellationToken get();
	void set(CancellationToken value);
}

Property Value

Type: System.Threading::CancellationToken

The token that is associated with this instance.

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.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1
Return to top
Show: