This commit is contained in:
tqcq 2024-10-26 10:48:24 +00:00
parent 84954da330
commit 234b57fae4

View File

@ -370,15 +370,16 @@ find_row_mask(std::vector<set_t> &sets,
step_count -= std::min(step_count, step / 10);
// my is new
if (my_pos > g_base_pos.load(std::memory_order_relaxed) + step_count) {
std::lock_guard<std::mutex> _(lock);
if (my_pos > g_base_pos + step_count) {
g_base_pos = my_pos;
row_mask = cur_mask;
}
} else {
} else if (g_base_pos.load(std::memory_order_relaxed) <= my_pos) {
std::lock_guard<std::mutex> _(lock);
if (g_base_pos + step_count <= my_pos) {
if (g_base_pos <= my_pos) {
cur_mask = row_mask;
step_count = my_pos - g_base_pos;
}