QemuEvent is currently broken on ARM due to missing memory barriers
after qatomic_*(). Apart from adding the memory barrier, a closer look
reveals some unpaired memory barriers that are not really needed and
complicated the functions unnecessarily, as well as some optimizations
that I couldn't quite prove to be correct.
Finally, the code is relying on a memory barrier in ResetEvent(); the
barrier_ought_ to be there but there is really no documentation about
it; it only affects the slow path, so make it explicit.
Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
---
util/qemu-thread-win32.c | 78 +++++++++++++++++++++++++++-------------
1 file changed, 53 insertions(+), 25 deletions(-)