From 4b5be3bea6677b2f10ed15b3e726b77bf6e3d3d0 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 1 Mar 2010 16:42:15 -0500 Subject: [PATCH] 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 --- urcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- 2.34.1