X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-qsbr.c;h=878a550b9291d21a464f5e4c1db9e58f1d741ea3;hb=332c334642672c5cf5e437f5ab2457ce6cddc21a;hp=6ba03642f852763057781dcf14bf2ff4a01dc5b9;hpb=3395d46cc4ab83f9c23ecc5410122111cce5905d;p=urcu.git diff --git a/urcu-qsbr.c b/urcu-qsbr.c index 6ba0364..878a550 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -251,6 +251,7 @@ static void rcu_remove_reader(pthread_t id) void rcu_register_thread(void) { + _rcu_thread_online(); internal_urcu_lock(); rcu_add_reader(pthread_self()); internal_urcu_unlock(); @@ -258,6 +259,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();