X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu-qsbr.c;h=0576f4142754e14840b839be35c71e72b200938a;hp=6ba03642f852763057781dcf14bf2ff4a01dc5b9;hb=fb6e510b9ae45b9b984b4646b4be6b9d7a2bbf7c;hpb=3395d46cc4ab83f9c23ecc5410122111cce5905d 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();