We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c24a99c commit 06484b4Copy full SHA for 06484b4
src/IntelOrca.Biohazard.BioRand.Common/RandomizerAgent.cs
@@ -87,9 +87,22 @@ private async Task RunInternalAsync(CancellationToken ct = default)
87
{
88
try
89
90
- await Task.WhenAny(
91
- RunStatusLoopAsync(ct),
92
- RunProcessLoopAsync(ct));
+ var localCts = new CancellationTokenSource();
+ var linked = CancellationTokenSource.CreateLinkedTokenSource(localCts.Token, ct);
+ var a = RunStatusLoopAsync(linked.Token);
93
+ var b = RunProcessLoopAsync(linked.Token);
94
+ try
95
+ {
96
+ await Task.WhenAny(a, b);
97
+ }
98
+ finally
99
100
+ localCts.Cancel();
101
+ await Task.WhenAll(a, b);
102
103
104
+ catch
105
106
}
107
finally
108
0 commit comments