X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-qsbr.c;h=a2cabb446afda2db312b6d42a00b8ea5f02a4769;hb=6278a922c993b7e2a2ed4e0e3e75fb642271f3ba;hp=76aaabb4eac85fbb11aefc487bab627aa241a384;hpb=6b702fa4ea05b4f6d37000d5cd26d19f0d0807e0;p=userspace-rcu.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))