Bug description
This method can be used to combine an arbitrary number of cancellation tokens:
|
public static CombinedCancellationToken CombineWith(this CancellationToken original, params CancellationToken[] others) |
If more than 2 of the provided tokens (including the original one that the extension method was called on) can be cancelled, the method goes into the least optimized code path here:
This code path forgets about the "original" cancellation token, and only combines the "others". As a result, the resulting combined cancellation token does not react to cancellation of the "original" token.
Repro steps
Described above.
Expected behavior
The resulting combined cancellation token should include and reflect cancellations on the "original" token as well as any "others".
Actual behavior
Instead the resulting combined cancellation token ignores the "original" token and only reflects cancellation on the "others".
Bug description
This method can be used to combine an arbitrary number of cancellation tokens:
vs-threading/src/Microsoft.VisualStudio.Threading/CancellationTokenExtensions.cs
Line 43 in 95d58be
If more than 2 of the provided tokens (including the original one that the extension method was called on) can be cancelled, the method goes into the least optimized code path here:
vs-threading/src/Microsoft.VisualStudio.Threading/CancellationTokenExtensions.cs
Line 113 in 95d58be
This code path forgets about the "original" cancellation token, and only combines the "others". As a result, the resulting combined cancellation token does not react to cancellation of the "original" token.
Repro steps
Described above.
Expected behavior
The resulting combined cancellation token should include and reflect cancellations on the "original" token as well as any "others".
Actual behavior
Instead the resulting combined cancellation token ignores the "original" token and only reflects cancellation on the "others".