diff --git a/vl.c b/vl.c index 4d9db0145cc9aebd717f1ce29562f70f9257bf8a..19e11b2f704f3837ef678989a734e431e06dbebe 100644 --- a/vl.c +++ b/vl.c @@ -3591,9 +3591,14 @@ void qemu_cpu_kick(void *_env) qemu_thread_signal(env->thread, SIGUSR1); } -int qemu_cpu_self(void *env) +int qemu_cpu_self(void *_env) { - return (cpu_single_env != NULL); + CPUState *env = _env; + QemuThread this; + + qemu_thread_self(&this); + + return qemu_thread_equal(&this, env->thread); } static void cpu_signal(int sig)