tests-aio-multithread: use atomic_read properly
commit1ab17f9f5c63c2798d707aeb22588e4fcc17b2cd
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Feb 2017 11:17:26 +0000 (27 12:17 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 27 Feb 2017 14:00:53 +0000 (27 14:00 +0000)
tree6ae3e0784c3a75bcea37c3d30bce2c2fb8a0b5f1
parentd045c466d9e62b4321fadf586d024d54ddfd8bd4
tests-aio-multithread: use atomic_read properly

nodes[id].next is written by other threads.  If atomic_read is not used
(matching atomic_set in mcs_mutex_lock!) the compiler can optimize the
whole "if" away!

Reported-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Greg Kurz <groug@kaod.org>
Message-id: 20170227111726.9237-1-pbonzini@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/test-aio-multithread.c