From 234b57fae432b91ab3b5ab47f83e6714ecb7b747 Mon Sep 17 00:00:00 2001 From: tqcq Date: Sat, 26 Oct 2024 10:48:24 +0000 Subject: [PATCH] fix --- drama/src/rev-mc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drama/src/rev-mc.c b/drama/src/rev-mc.c index d448aae..3f225f4 100644 --- a/drama/src/rev-mc.c +++ b/drama/src/rev-mc.c @@ -370,15 +370,16 @@ find_row_mask(std::vector &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 _(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 _(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; }