urcu: fix multiple register/unregister assertion failure
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 1 Mar 2010 21:42:15 +0000 (16:42 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 1 Mar 2010 21:42:15 +0000 (16:42 -0500)
Caused by the fact that we check for the whole gp count (which includes the last
grace period phase bit) rather than just checking if the nesting count mask is
zero.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu.c

diff --git a/urcu.c b/urcu.c
index 5d09a62cfe935072ed0f9471a70c59d0cab4f98e..b8567555d09ecbb22547aa6f236392d439eea871 100644 (file)
--- a/urcu.c
+++ b/urcu.c
@@ -346,7 +346,7 @@ void rcu_register_thread(void)
 {
        rcu_reader.tid = pthread_self();
        assert(rcu_reader.need_mb == 0);
-       assert(rcu_reader.ctr == 0);
+       assert(!(rcu_reader.ctr & RCU_GP_CTR_NEST_MASK));
 
        mutex_lock(&rcu_gp_lock);
        rcu_init();     /* In case gcc does not support constructor attribute */
This page took 0.033003 seconds and 4 git commands to generate.