- if (uatomic_read(&rcu_gp_futex) == -1)
- futex_noasync(&rcu_gp_futex, FUTEX_WAIT, -1,
- NULL, NULL, 0);
-}
-
-/*
- * Note: urcu_adaptative_wake_up needs "value" to stay allocated
- * throughout its execution. In this scheme, the waiter owns the futex
- * memory, and we only allow it to free this memory when it receives the
- * AWAKE_TEARDOWN flag.
- */
-static void urcu_adaptative_wake_up(int32_t *value)
-{
- cmm_smp_mb();
- assert(uatomic_read(value) == AWAKE_WAITING);
- uatomic_set(value, AWAKE_WAKEUP);
- if (!(uatomic_read(value) & AWAKE_AWAKENED))
- futex_noasync(value, FUTEX_WAKE, 1, NULL, NULL, 0);
- /* Allow teardown of "value" memory. */
- uatomic_or(value, AWAKE_TEARDOWN);
+ if (uatomic_read(&rcu_gp.futex) != -1)
+ return;
+ while (futex_noasync(&rcu_gp.futex, FUTEX_WAIT, -1,
+ NULL, NULL, 0)) {
+ switch (errno) {
+ case EWOULDBLOCK:
+ /* Value already changed. */
+ return;
+ case EINTR:
+ /* Retry if interrupted by signal. */
+ break; /* Get out of switch. */
+ default:
+ /* Unexpected error. */
+ urcu_die(errno);
+ }
+ }