summaryrefslogtreecommitdiffstats
path: root/softmmu/cpus.c
diff options
context:
space:
mode:
Diffstat (limited to 'softmmu/cpus.c')
-rw-r--r--softmmu/cpus.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index 01c94fd298..5a584a8d57 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -437,18 +437,19 @@ void qemu_wait_io_event(CPUState *cpu)
void cpus_kick_thread(CPUState *cpu)
{
-#ifndef _WIN32
- int err;
-
if (cpu->thread_kicked) {
return;
}
cpu->thread_kicked = true;
- err = pthread_kill(cpu->thread->thread, SIG_IPI);
+
+#ifndef _WIN32
+ int err = pthread_kill(cpu->thread->thread, SIG_IPI);
if (err && err != ESRCH) {
fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
exit(1);
}
+#else
+ qemu_sem_post(&cpu->sem);
#endif
}