mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
cpu: atomically modify cpu->exit_request
ThreadSanitizer picks up potential races although we already use barriers to ensure things are in the correct order when processing exit requests. For true C11 defined behaviour across threads we need to use relaxed atomic_set/atomic_read semantics to reassure tsan. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20160930213106.20186-9-alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
ce7cf6a973
commit
027d9a7d29
2 changed files with 6 additions and 6 deletions
|
@ -120,10 +120,10 @@ void cpu_reset_interrupt(CPUState *cpu, int mask)
|
|||
|
||||
void cpu_exit(CPUState *cpu)
|
||||
{
|
||||
cpu->exit_request = 1;
|
||||
atomic_set(&cpu->exit_request, 1);
|
||||
/* Ensure cpu_exec will see the exit request after TCG has exited. */
|
||||
smp_wmb();
|
||||
cpu->tcg_exit_req = 1;
|
||||
atomic_set(&cpu->tcg_exit_req, 1);
|
||||
}
|
||||
|
||||
int cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue