qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 32/47] cpus: dummy: unregister thread with RCU, exit


From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 32/47] cpus: dummy: unregister thread with RCU, exit loop on unplug
Date: Mon, 5 Feb 2018 20:28:46 +0100

Signed-off-by: Paolo Bonzini <address@hidden>
---
 cpus.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cpus.c b/cpus.c
index 1063dac..190ad5a 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1234,7 +1234,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
     cpu->created = true;
     qemu_cond_signal(&qemu_cpu_cond);
 
-    while (1) {
+    do {
         qemu_mutex_unlock_iothread();
         do {
             int sig;
@@ -1246,8 +1246,9 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
         }
         qemu_mutex_lock_iothread();
         qemu_wait_io_event(cpu);
-    }
+    } while (!cpu->unplug);
 
+    rcu_unregister_thread();
     return NULL;
 #endif
 }
-- 
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]