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 82d76e1 commit 213b927Copy full SHA for 213b927
src/coverlet.collector/Utilities/CountDownEvent.cs
@@ -31,13 +31,10 @@ public void Signal()
31
32
public void Wait()
33
{
34
- // We wait on another thread to avoid to block forever
35
- // We could use Task/Task.Delay timeout trick but this api and collector are sync so to
36
- // avoid too much GetAwaiter()/GetResult() I prefer keep code simple.
37
- // This thread is created only one time where we pass coverage files
38
- var waitOnThread = new Thread(() => _countDownEvent.Wait());
39
- waitOnThread.Start();
40
- waitOnThread.Join(_waitTimeout);
+ if (!_countDownEvent.Wait(_waitTimeout))
+ {
+ throw new TimeoutException($"CollectorCountdownEvent timeout after {_waitTimeout}");
+ }
41
}
42
43
0 commit comments