.NET Framework Class Library |
CancellationTokenSource..::.CreateLinkedTokenSource Method (CancellationToken, CancellationToken) |
CancellationTokenSource Class See Also Send Feedback |
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 ( _ token1 As CancellationToken, _ token2 As CancellationToken _ ) As CancellationTokenSource |
C# |
---|
public static CancellationTokenSource CreateLinkedTokenSource( CancellationToken token1, CancellationToken token2 ) |
Parameters
- token1
- Type: System.Threading..::.CancellationToken
The first CancellationToken to observe.
- token2
- Type: System.Threading..::.CancellationToken
The second CancellationToken to observe.
Return Value
A CancellationTokenSource that is linked to the source tokens.Exceptions
Exception | Condition |
---|---|
System..::.ObjectDisposedException | A CancellationTokenSource associated with one of the source tokens has been disposed. |