- uatomic_dec(&gp_futex);
- smp_mb(); /* Write futex before read reader_gp */
- if (!rcu_gp_ongoing(&index->ctr)) {
- /* Read reader_gp before write futex */
- smp_mb();
- /* Callbacks are queued, don't wait. */
- uatomic_set(&gp_futex, 0);
- } else {
- /* Read reader_gp before read futex */
- smp_rmb();
- if (uatomic_read(&gp_futex) == -1)
- futex(&gp_futex, FUTEX_WAIT, -1,
- NULL, NULL, 0);
- }
+ /* Read reader_gp before read futex */
+ smp_rmb();
+ if (uatomic_read(&gp_futex) == -1)
+ futex(&gp_futex, FUTEX_WAIT, -1,
+ NULL, NULL, 0);