diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-01-30 11:04:53 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-02-07 14:09:25 +0100 |
commit | d2831ab065765c8af13a5bb42627150323a96662 (patch) | |
tree | 9ea2b494b09d04df81d14dee53e764865b90191d /cpus.c | |
parent | 57615ed56c005ba0405420eb871f85fa1e5e563b (diff) |
cpus: dummy: unregister thread with RCU, exit loop on unplug
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cpus.c')
-rw-r--r-- | cpus.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 } |