X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=src%2Furcu-wait.h;fp=src%2Furcu-wait.h;h=1fa95c305dee77f944be5930b8dc7a092f66d17a;hp=68a42dac22c67c8df9e14608a52c05b3b109e0f7;hb=2ea38794876c907639971035ed29c4e59964fd7f;hpb=d18544842bdfbf2cba6c194a8e8d305ddf5e295e diff --git a/src/urcu-wait.h b/src/urcu-wait.h index 68a42da..1fa95c3 100644 --- a/src/urcu-wait.h +++ b/src/urcu-wait.h @@ -122,7 +122,7 @@ void urcu_adaptative_wake_up(struct urcu_wait_node *wait) urcu_die(errno); } /* Allow teardown of struct urcu_wait memory. */ - uatomic_or(&wait->state, URCU_WAIT_TEARDOWN); + uatomic_or_mo(&wait->state, URCU_WAIT_TEARDOWN, CMM_RELEASE); } /* @@ -180,7 +180,7 @@ skip_futex_wait: break; caa_cpu_relax(); } - while (!(uatomic_read(&wait->state) & URCU_WAIT_TEARDOWN)) + while (!(uatomic_load(&wait->state, CMM_ACQUIRE) & URCU_WAIT_TEARDOWN)) poll(NULL, 0, 10); urcu_posix_assert(uatomic_read(&wait->state) & URCU_WAIT_TEARDOWN); } @@ -196,7 +196,7 @@ void urcu_wake_all_waiters(struct urcu_waiters *waiters) caa_container_of(iter, struct urcu_wait_node, node); /* Don't wake already running threads */ - if (wait_node->state & URCU_WAIT_RUNNING) + if (uatomic_load(&wait_node->state, CMM_RELAXED) & URCU_WAIT_RUNNING) continue; urcu_adaptative_wake_up(wait_node); }