From d1238495fdaf1c85447690231bf5d1838b83bf88 Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Tue, 15 Sep 2009 16:17:22 -0400 Subject: [PATCH] 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 --- urcu-qsbr.c | 3 +++ 1 file changed, 3 insertions(+) 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; /* -- 2.34.1