X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-qsbr.c;h=d8ae1c1257517645e22ef143b8b23950ff330d1b;hb=f2aa49059a94eefed3bd9fbbbdd5207845c7ef39;hp=d02572513139eb5986529328c0066deb319cafc9;hpb=e998132a6aeae4c12f2af1369c7831449be9b00c;p=urcu.git diff --git a/urcu-qsbr.c b/urcu-qsbr.c index d025725..d8ae1c1 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -130,6 +130,8 @@ static void wait_for_readers(struct cds_list_head *input_readers, * current rcu_gp.ctr value. */ for (;;) { + if (wait_loops < RCU_QS_ACTIVE_ATTEMPTS) + wait_loops++; if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) { uatomic_set(&rcu_gp.futex, -1); /* @@ -142,8 +144,6 @@ static void wait_for_readers(struct cds_list_head *input_readers, } /* Write futex before read reader_gp */ cmm_smp_mb(); - } else { - wait_loops++; } cds_list_for_each_entry_safe(index, tmp, input_readers, node) { switch (rcu_reader_state(&index->ctr)) {