aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpus.c b/cpus.c
index e831aa398f..6cebb7aa92 100644
--- a/cpus.c
+++ b/cpus.c
@@ -663,8 +663,9 @@ static void cpu_handle_guest_debug(CPUState *cpu)
static void cpu_signal(int sig)
{
- if (current_cpu) {
- cpu_exit(current_cpu);
+ CPUState *cpu = atomic_mb_read(&tcg_current_cpu);
+ if (cpu) {
+ cpu_exit(cpu);
}
exit_request = 1;
}