Commit f91bed86 authored by Kenton Varda's avatar Kenton Varda

Improve reliability of xthread cancellation test.

parent b98b31ac
...@@ -338,16 +338,17 @@ KJ_TEST("cancel cross-thread event while it runs") { ...@@ -338,16 +338,17 @@ KJ_TEST("cancel cross-thread event while it runs") {
exec = &KJ_ASSERT_NONNULL(*lock); exec = &KJ_ASSERT_NONNULL(*lock);
} }
volatile bool called = false;
{ {
volatile bool called = false;
Promise<uint> promise = exec->executeAsync([&]() -> kj::Promise<uint> { Promise<uint> promise = exec->executeAsync([&]() -> kj::Promise<uint> {
called = true; called = true;
return kj::NEVER_DONE; return kj::NEVER_DONE;
}); });
while (!called) {
delay(); delay();
}
KJ_EXPECT(!promise.poll(waitScope)); KJ_EXPECT(!promise.poll(waitScope));
} }
KJ_EXPECT(called);
exec->executeSync([&]() { fulfiller->fulfill(); }); exec->executeSync([&]() { fulfiller->fulfill(); });
......
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