From 7fc80525e9f197c9a655b08b2cf182d03048a365 Mon Sep 17 00:00:00 2001 From: Jun Tian Date: Fri, 14 Dec 2012 08:43:15 +0800 Subject: [PATCH] Fix the emulator exit hang up issue --- cpus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpus.c b/cpus.c index 9def8b8..4659db4 100644 --- a/cpus.c +++ b/cpus.c @@ -859,6 +859,13 @@ static void qemu_cpu_kick_thread(CPUArchState *env) fprintf(stderr, "qemu:%s: %s", __func__, strerror(err)); exit(1); } +/* The cpu thread cannot catch it reliably when shutdown the guest on Mac. + * We can double check it and resend it + */ +#ifdef CONFIG_DARWIN + if (!exit_request) + cpu_signal(0); +#endif #else /* _WIN32 */ if (!qemu_cpu_is_self(env)) { SuspendThread(cpu->hThread); -- 2.7.4