forked from boostorg/unordered
Test if being the kind of program that calls yield() pays dividends for flaky CI failures
This commit is contained in:
@ -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,6 +216,7 @@ namespace {
|
|||||||
}
|
}
|
||||||
x1.swap(x2);
|
x1.swap(x2);
|
||||||
++num_swaps;
|
++num_swaps;
|
||||||
|
std::this_thread::yield();
|
||||||
} while (!done1 && !done2);
|
} while (!done1 && !done2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user