X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu.c;h=8420ee494cef759bc2b87287168bacddc525315c;hb=996311b1befac8bd4dc3ba8103427815aa6d9556;hp=33e35e1d36a722cb2de2f74e8f3a15c8327f3687;hpb=6b702fa4ea05b4f6d37000d5cd26d19f0d0807e0;p=userspace-rcu.git diff --git a/urcu.c b/urcu.c index 33e35e1..8420ee4 100644 --- a/urcu.c +++ b/urcu.c @@ -247,12 +247,12 @@ void update_counter_and_wait(void) * Wait for each thread URCU_TLS(rcu_reader).ctr count to become 0. */ for (;;) { + if (wait_loops < RCU_QS_ACTIVE_ATTEMPTS) + wait_loops++; if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) { uatomic_dec(&gp_futex); /* Write futex before read reader_gp */ smp_mb_master(RCU_MB_GROUP); - } else { - wait_loops++; } cds_list_for_each_entry_safe(index, tmp, ®istry, node) {