mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Fix bug in swap_test iteration logic that caused early termination of the swap loop
This commit is contained in:
@ -191,7 +191,6 @@ namespace {
|
||||
if (idx % 100 == 0) {
|
||||
cv.notify_all();
|
||||
}
|
||||
std::this_thread::yield();
|
||||
}
|
||||
|
||||
done1 = true;
|
||||
@ -202,7 +201,6 @@ namespace {
|
||||
|
||||
for (auto const& val : vals2) {
|
||||
x2.insert(val);
|
||||
std::this_thread::yield();
|
||||
}
|
||||
|
||||
done2 = true;
|
||||
@ -216,8 +214,7 @@ namespace {
|
||||
}
|
||||
x1.swap(x2);
|
||||
++num_swaps;
|
||||
std::this_thread::yield();
|
||||
} while (!done1 && !done2);
|
||||
} while (!done1 || !done2);
|
||||
});
|
||||
|
||||
t1.join();
|
||||
|
Reference in New Issue
Block a user