qsbr: only mark reader thread as being waited for in contended case urcu/yield
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Sat, 26 Sep 2009 22:29:37 +0000 (18:29 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Sat, 26 Sep 2009 22:29:37 +0000 (18:29 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
urcu-qsbr.c

index c275b6670672de62fc76aed22ba432d6deea2b44..ad3d17a63417ab1f6eea38ec5fec8529f49c5faa 100644 (file)
@@ -114,6 +114,9 @@ static void wait_for_quiescent_state(void)
        for (index = registry; index < registry + num_readers; index++) {
                int wait_loops = 0;
 
+               if (likely(!rcu_gp_ongoing(&index->urcu_reader_status->qs_gp)))
+                       continue;
+       
                index->urcu_reader_status->gp_waiting = 1;
                while (rcu_gp_ongoing(&index->urcu_reader_status->qs_gp)) {
                        if (wait_loops++ == RCU_QS_ACTIVE_ATTEMPTS) {
This page took 0.025346 seconds and 4 git commands to generate.