File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,10 @@ struct waiter_helper {
3333 auto & counter = ctrl.counter ();
3434 counter.waiting_ .fetch_add (1 , std::memory_order_release);
3535 flags.is_waiting_ .store (true , std::memory_order_relaxed);
36- auto finally = ipc::guard ([&counter, &flags] {
37- for (auto curr_wait = counter.waiting_ .load (std::memory_order_acquire); curr_wait > 0 ;) {
38- if (counter.waiting_ .compare_exchange_weak (curr_wait, curr_wait - 1 , std::memory_order_release)) {
36+ auto finally = ipc::guard ([&ctrl, &counter, &flags] {
37+ ctrl.get_lock (); // barrier
38+ for (auto curr_wait = counter.waiting_ .load (std::memory_order_relaxed); curr_wait > 0 ;) {
39+ if (counter.waiting_ .compare_exchange_weak (curr_wait, curr_wait - 1 , std::memory_order_acq_rel)) {
3940 break ;
4041 }
4142 }
You can’t perform that action at this time.
0 commit comments