X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=urcu-qsbr.c;h=a2cabb446afda2db312b6d42a00b8ea5f02a4769;hb=cca4c8dc770c0a5d6cdcd7375fd9d949ab5d7b99;hp=76aaabb4eac85fbb11aefc487bab627aa241a384;hpb=f6d1a94fb64e9beeaf4558f12c157784831d9084;p=urcu.git diff --git a/urcu-qsbr.c b/urcu-qsbr.c index 76aaabb..a2cabb4 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -150,6 +150,8 @@ static void update_counter_and_wait(void) * Wait for each thread rcu_reader_qs_gp count to become 0. */ for (;;) { + if (wait_loops < RCU_QS_ACTIVE_ATTEMPTS) + wait_loops++; if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) { uatomic_set(&gp_futex, -1); /* @@ -162,8 +164,6 @@ static void update_counter_and_wait(void) } /* Write futex before read reader_gp */ cmm_smp_mb(); - } else { - wait_loops++; } cds_list_for_each_entry_safe(index, tmp, ®istry, node) { if (!rcu_gp_ongoing(&index->ctr))