From: Mathieu Desnoyers Date: Mon, 1 Mar 2010 21:42:15 +0000 (-0500) Subject: urcu: fix multiple register/unregister assertion failure X-Git-Tag: v0.4.2~7 X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=commitdiff_plain;h=4b5be3bea6677b2f10ed15b3e726b77bf6e3d3d0 urcu: fix multiple register/unregister assertion failure 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 --- diff --git a/urcu.c b/urcu.c index 5d09a62..b856755 100644 --- 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 */