Commit d2831ab0 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

cpus: dummy: unregister thread with RCU, exit loop on unplug

parent 57615ed5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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
}