Fix: memory leak in urcu-checker
[userspace-rcu.git] / urcu.c
diff --git a/urcu.c b/urcu.c
index d6dec1afa288a38c3faf523947ae4f9f7b9150ef..d86cb6cad2a646ae27608429512a3b971ebd435a 100644 (file)
--- 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();
This page took 0.022487 seconds and 4 git commands to generate.