cpus_kick_thread() is called via cpu_exit() -> qemu_cpu_kick(),
and also via gdb_syscall_handling(). Access the CPUState field
using atomic accesses. See commit
8ac2ca02744 ("accel: use atomic
accesses for exit_request") for rationale.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-Id: <
20250925025520.71805-3-philmd@linaro.org>
void cpus_kick_thread(CPUState *cpu)
{
- if (cpu->thread_kicked) {
+ if (qatomic_read(&cpu->thread_kicked)) {
return;
}
- cpu->thread_kicked = true;
+ qatomic_set(&cpu->thread_kicked, true);
#ifndef _WIN32
int err = pthread_kill(cpu->thread->thread, SIG_IPI);