CreateLinkedTokenSource()

CancellationTokenSource::CreateLinkedTokenSource(const CancellationToken&, const CancellationToken&) method

Creates a linked token source that cancels when any of the provided tokens cancel.

static SharedPtr<CancellationTokenSource> System::Threading::CancellationTokenSource::CreateLinkedTokenSource(const CancellationToken &token1, const CancellationToken &token2)

Arguments

ParameterTypeDescription
token1const CancellationToken&First cancellation token to monitor.
token2const CancellationToken&Second cancellation token to monitor.

Return Value

New token source that will cancel when either input token cancels.

Remarks

The returned source will immediately cancel if either input token is already canceled.

See Also