Commit 2cbcfb28 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

atomic: fix position of volatile qualifier



What needs to be volatile is not the pointer, but the pointed-to
value!

Cc: qemu-stable@nongnu.org
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent c95f3901
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -122,11 +122,11 @@
#endif

#ifndef atomic_read
#define atomic_read(ptr)       (*(__typeof__(*ptr) *volatile) (ptr))
#define atomic_read(ptr)       (*(__typeof__(*ptr) volatile*) (ptr))
#endif

#ifndef atomic_set
#define atomic_set(ptr, i)     ((*(__typeof__(*ptr) *volatile) (ptr)) = (i))
#define atomic_set(ptr, i)     ((*(__typeof__(*ptr) volatile*) (ptr)) = (i))
#endif

/* These have the same semantics as Java volatile variables.