Commit 3a9c6665 authored by Kenton Varda's avatar Kenton Varda

Fix deadlock in xthread test when one thread falls too far behind.

I guess this is particularly likely to happen when the threads are sharing a single core, which is probably common in CI services, explaining why I had trouble reproducing on my own hardware.
parent 6f8afcf3
......@@ -397,7 +397,7 @@ KJ_TEST("cross-thread cancellation in both directions at once") {
{
auto lock = readyCount.lockExclusive();
++*lock;
lock.wait([&](uint i) { return i == threadCount; });
lock.wait([&](uint i) { return i >= threadCount; });
}
// Run event loop to start all executions queued by the other thread.
......@@ -408,7 +408,7 @@ KJ_TEST("cross-thread cancellation in both directions at once") {
{
auto lock = readyCount.lockExclusive();
++*lock;
lock.wait([&](uint i) { return i == threadCount * 2; });
lock.wait([&](uint i) { return i >= threadCount * 2; });
}
// Cancel all the promises.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment