As mentioned in the previous commit message, rcu_thread_offline
is useful to avoid deadlocks between rcu_unregister_thread and
synchronize_rcu.  Just like in urcu-qsbr.c, put a thread offline
before it unregisters itself.

An additional benefit is that a thread can unregister itself and
register itself later without triggering the assertion in
rcu_register_thread().

Signed-off-by: Paolo Bonzini <[email protected]>
---
 urcu.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/urcu.c b/urcu.c
index dee8b59..e82bf6c 100644
--- a/urcu.c
+++ b/urcu.c
@@ -383,6 +383,7 @@ void rcu_register_thread(void)
 
 void rcu_unregister_thread(void)
 {
+       _rcu_thread_offline();
        mutex_lock(&rcu_gp_lock);
        list_del(&rcu_reader.head);
        mutex_unlock(&rcu_gp_lock);
-- 
1.6.6



_______________________________________________
ltt-dev mailing list
[email protected]
http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev

Reply via email to