From: Mathieu Desnoyers Date: Wed, 10 Jun 2009 16:01:47 +0000 (-0400) Subject: Fix deadlock in qsbr code X-Git-Tag: v0.1~175 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=76f3022fdb3eaa23decfa5a61be4b351eb1a0114;p=urcu.git Fix deadlock in qsbr code Readers must go offline because they unregister. Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-qsbr.c b/urcu-qsbr.c index 6ba0364..87c83d7 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -258,6 +258,11 @@ void rcu_register_thread(void) void rcu_unregister_thread(void) { + /* + * We have to make the thread offline otherwise we end up dealocking + * with a waiting writer. + */ + _rcu_thread_offline(); internal_urcu_lock(); rcu_remove_reader(pthread_self()); internal_urcu_unlock();