qsbr: only mark reader thread as being waited for in contended case urcu/qsbr/adaptusleep
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:32:21 +0000 (18:32 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
urcu-qsbr.c

index a71ee6631b2b9dce77748b98937bcc58238d3ad3..9b3210a6fde03412f401a68c54c5b073bdc357cd 100644 (file)
@@ -115,6 +115,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.025924 seconds and 4 git commands to generate.