X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-qsbr.c;h=0576f4142754e14840b839be35c71e72b200938a;hb=cee02f0ab0a6766662490f2d815d487c098c17b1;hp=6ba03642f852763057781dcf14bf2ff4a01dc5b9;hpb=3395d46cc4ab83f9c23ecc5410122111cce5905d;p=urcu.git diff --git a/urcu-qsbr.c b/urcu-qsbr.c index 6ba0364..0576f41 100644 --- a/urcu-qsbr.c +++ b/urcu-qsbr.c @@ -254,10 +254,16 @@ void rcu_register_thread(void) internal_urcu_lock(); rcu_add_reader(pthread_self()); internal_urcu_unlock(); + _rcu_thread_online(); } 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();