From 76f3022fdb3eaa23decfa5a61be4b351eb1a0114 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 10 Jun 2009 12:01:47 -0400 Subject: [PATCH] Fix deadlock in qsbr code Readers must go offline because they unregister. Signed-off-by: Mathieu Desnoyers --- urcu-qsbr.c | 5 +++++ 1 file changed, 5 insertions(+) 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(); -- 2.34.1