fix :error
This commit is contained in:
parent
8a74c8e78f
commit
c7246f9740
@ -340,22 +340,23 @@ find_row_mask(std::vector<set_t> &sets,
|
|||||||
// step /= thread_num;
|
// step /= thread_num;
|
||||||
// if (!step) { ++step; }
|
// if (!step) { ++step; }
|
||||||
fprintf(stderr, "worker_step: %ld\n", outer_step);
|
fprintf(stderr, "worker_step: %ld\n", outer_step);
|
||||||
auto try_update_row_mask = [&](uint64_t pos, uint64_t mask) {
|
auto try_update_row_mask = [&](uint64_t cur_pos, uint64_t cur_mask) {
|
||||||
if (pos > g_base_pos.load(std::memory_order_relaxed)) {
|
if (cur_pos > g_base_pos.load(std::memory_order_relaxed)) {
|
||||||
std::lock_guard<std::mutex> _(lock);
|
std::lock_guard<std::mutex> _(lock);
|
||||||
if (pos > g_base_pos.load()) {
|
if (cur_pos > g_base_pos.load()) {
|
||||||
g_base_pos = row_mask;
|
g_base_pos = cur_pos;
|
||||||
row_mask = mask;
|
row_mask = cur_mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto try_get_row_mask = [&](uint64_t end_pos, uint64_t &diff, uint64_t &cur_mask) {
|
auto try_get_row_mask = [&](uint64_t end_pos, uint64_t &diff, uint64_t &cur_mask) {
|
||||||
uint64_t v = g_base_pos.load(std::memory_order_relaxed);
|
uint64_t v = g_base_pos.load(std::memory_order_relaxed);
|
||||||
if (end_pos - diff < v && end_pos >= v) {
|
uint64_t cur_pos = end_pos - diff;
|
||||||
|
if (cur_pos < v && end_pos >= v) {
|
||||||
std::lock_guard<std::mutex> _(lock);
|
std::lock_guard<std::mutex> _(lock);
|
||||||
v = g_base_pos.load();
|
if (cur_pos < v && end_pos >= v) {
|
||||||
if (end_pos - diff < v && end_pos >= v) {
|
diff = end_pos - g_base_pos.load();
|
||||||
diff = end_pos - v;
|
|
||||||
cur_mask = row_mask;
|
cur_mask = row_mask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user