CreateLinkedTokenSource Method (CancellationToken[])

Task Parallel System.Threading

Creates a CancellationTokenSource that will be in the canceled state when any of the source tokens are in the canceled state.

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

Syntax

Visual Basic (Declaration)
Public Shared Function CreateLinkedTokenSource ( _
	ParamArray tokens As CancellationToken() _
) As CancellationTokenSource
C#
public static CancellationTokenSource CreateLinkedTokenSource(
	params CancellationToken[] tokens
)

Parameters

tokens
Type: array< System.Threading..::.CancellationToken >[]()[]
The CancellationToken instances to observe.

Return Value

A CancellationTokenSource that is linked to the source tokens.

Exceptions

ExceptionCondition
System..::.ArgumentNullExceptiontokens is null.
System..::.ObjectDisposedExceptionA CancellationTokenSource associated with one of the source tokens has been disposed.

See Also