Creates a
If the token is canceled, all async operations using that
TaskSource whose entire lifetime is linked to the provided token.If the token is canceled, all async operations using that
TaskSource are canceled.Example on how this differs from
CreateLinkedTokenSource()var cts = new CancellationTokenSource(); TaskSource ts = TaskSource.Create(cts.Token); await ts.DelaySeconds(5); // if cts.Token is canceled, ts becomes invalid
var cts = TaskSource.CreateLinkedTokenSource(); TaskSource ts = new TaskSource(); await ts.DelaySeconds(5, cts.Token); // if cts.Token is cancelled only this delay is canceled await ts.DelaySeconds(5) // Still Valid