From: Paolo Bonzini Date: Tue, 30 Jan 2018 16:04:53 +0000 (-0500) Subject: cpus: dummy: unregister thread with RCU, exit loop on unplug X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d2831ab065765c8af13a5bb42627150323a96662;p=qmiga%2Fqemu.git cpus: dummy: unregister thread with RCU, exit loop on unplug Signed-off-by: Paolo Bonzini --- diff --git a/cpus.c b/cpus.c index 1063dace88..190ad5aabb 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 }