Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateLinkedTokenSource Method (CancellationToken, CancellationToken)

CancellationTokenSource.CreateLinkedTokenSource Method (CancellationToken, CancellationToken)

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

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

static member CreateLinkedTokenSource : 
        token1:CancellationToken * 
        token2:CancellationToken -> CancellationTokenSource

Parameters

token1
Type: System.Threading.CancellationToken

The first cancellation token to observe.

token2
Type: System.Threading.CancellationToken

The second cancellation token to observe.

Return Value

Type: System.Threading.CancellationTokenSource
A CancellationTokenSource that is linked to the source tokens.

ExceptionCondition
ObjectDisposedException

A CancellationTokenSource associated with one of the source tokens has been disposed.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft