From: Pierre Habouzit Date: Tue, 15 Sep 2009 20:17:22 +0000 (-0400) Subject: qsbr urcu: make it safe to call rcu_sychronize from a registered thread. X-Git-Tag: v0.1~91 X-Git-Url: https://git.lttng.org/?p=urcu.git;a=commitdiff_plain;h=d1238495fdaf1c85447690231bf5d1838b83bf88 qsbr urcu: make it safe to call rcu_sychronize from a registered thread. Else, since calling rcu_sychronize will increment urcu_gp_ctr, we will be stupidly waiting for ourselves and deadlock. No need to use _rcu_quiescent_state() since we are currently owning the internal URCU lock, so the memory barriers and ACCESS_ONCE() are overkill. Signed-off-by: Pierre Habouzit Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-qsbr.c b/urcu-qsbr.c index 14733ab..c0f0554 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -114,6 +114,9 @@ static void wait_for_quiescent_state(void) { struct reader_registry *index; + if (rcu_reader_qs_gp & 1) + rcu_reader_qs_gp = urcu_gp_ctr + 1; + if (!registry) return; /*