qemu-thread-win32: cleanup, fix, document QemuEvent
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 2 Mar 2023 10:22:50 +0000 (11:22 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Mar 2023 11:38:40 +0000 (12:38 +0100)
commit6c5df4b48f0c52a61342ecb307a43f4c2a3565c4
tree6dfae8f603c1bc92750018169117180a4488bf61
parent9586a1329f5dce6c1d7f4de53cf0536644d7e593
qemu-thread-win32: cleanup, fix, document QemuEvent

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.  Also, it is relying on
a memory barrier in ResetEvent(); the barrier _ought_ to be there
but there is really no documentation about it, so make it explicit.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
util/qemu-thread-win32.c