Attempt to fix flaky CI

This commit is contained in:
Christian Mazakas
2023-05-03 11:22:07 -07:00
parent 3fe0807ae9
commit 3c0fb0fa1b

View File

@@ -191,6 +191,7 @@ namespace {
if (idx % 100 == 0) { if (idx % 100 == 0) {
cv.notify_all(); cv.notify_all();
} }
std::this_thread::yield();
} }
done1 = true; done1 = true;
@@ -201,6 +202,7 @@ namespace {
for (auto const& val : vals2) { for (auto const& val : vals2) {
x2.insert(val); x2.insert(val);
std::this_thread::yield();
} }
done2 = true; done2 = true;
@@ -214,7 +216,11 @@ namespace {
} }
x1.swap(x2); x1.swap(x2);
++num_swaps; ++num_swaps;
std::this_thread::yield();
} while (!done1 || !done2); } while (!done1 || !done2);
BOOST_TEST(done1);
BOOST_TEST(done2);
}); });
t1.join(); t1.join();