X-Git-Url: http://git.liburcu.org/?p=userspace-rcu.git;a=blobdiff_plain;f=urcu.c;h=8420ee494cef759bc2b87287168bacddc525315c;hp=33e35e1d36a722cb2de2f74e8f3a15c8327f3687;hb=cca4c8dc770c0a5d6cdcd7375fd9d949ab5d7b99;hpb=f6d1a94fb64e9beeaf4558f12c157784831d9084 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) {