diff options
-rw-r--r-- | cpu-exec.c | 3 | ||||
-rw-r--r-- | cpus.c | 3 |
2 files changed, 3 insertions, 3 deletions
@@ -237,9 +237,8 @@ int cpu_exec(CPUState *env1) barrier(); env = env1; - if (exit_request) { + if (unlikely(exit_request)) { env->exit_request = 1; - exit_request = 0; } #if defined(TARGET_I386) @@ -770,7 +770,7 @@ bool tcg_cpu_exec(void) if (next_cpu == NULL) next_cpu = first_cpu; - for (; next_cpu != NULL; next_cpu = next_cpu->next_cpu) { + for (; next_cpu != NULL && !exit_request; next_cpu = next_cpu->next_cpu) { CPUState *env = cur_cpu = next_cpu; qemu_clock_enable(vm_clock, @@ -789,6 +789,7 @@ bool tcg_cpu_exec(void) break; } } + exit_request = 0; return tcg_has_work(); } |