X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu.c;h=d86cb6cad2a646ae27608429512a3b971ebd435a;hb=refs%2Fheads%2Furcu%2Frcu-checker;hp=d6dec1afa288a38c3faf523947ae4f9f7b9150ef;hpb=9340c38dbff1b407f35008f7f585a238fbd4de1c;p=userspace-rcu.git diff --git a/urcu.c b/urcu.c index d6dec1a..d86cb6c 100644 --- a/urcu.c +++ b/urcu.c @@ -242,12 +242,12 @@ static void wait_for_readers(struct cds_list_head *input_readers, * rcu_gp.ctr value. */ for (;;) { + if (wait_loops < RCU_QS_ACTIVE_ATTEMPTS) + wait_loops++; if (wait_loops >= RCU_QS_ACTIVE_ATTEMPTS) { uatomic_dec(&rcu_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, input_readers, node) { @@ -441,6 +441,8 @@ int rcu_read_ongoing(void) return _rcu_read_ongoing(); } + + void rcu_register_thread(void) { URCU_TLS(rcu_reader).tid = pthread_self();