System::Threading::CancellationTokenSource::CreateLinkedTokenSource method

CancellationTokenSource::CreateLinkedTokenSource 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)
ParameterTypeDescription
token1const CancellationToken&First cancellation token to monitor.
token2const CancellationToken&Second cancellation token to monitor.

ReturnValue

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