mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request v2: * v1 emails 2/3 and 3/3 weren't sent due to an email failure * Included Sergio's updated wording in the commit description # gpg: Signature made Wed 08 Nov 2017 19:12:01 GMT # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: util/async: use atomic_mb_set in qemu_bh_cancel tests-aio-multithread: fix /aio/multi/schedule race condition Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -144,17 +144,16 @@ static void finish_cb(void *opaque)
|
||||
static coroutine_fn void test_multi_co_schedule_entry(void *opaque)
|
||||
{
|
||||
g_assert(to_schedule[id] == NULL);
|
||||
atomic_mb_set(&to_schedule[id], qemu_coroutine_self());
|
||||
|
||||
while (!atomic_mb_read(&now_stopping)) {
|
||||
int n;
|
||||
|
||||
n = g_test_rand_int_range(0, NUM_CONTEXTS);
|
||||
schedule_next(n);
|
||||
qemu_coroutine_yield();
|
||||
|
||||
g_assert(to_schedule[id] == NULL);
|
||||
atomic_mb_set(&to_schedule[id], qemu_coroutine_self());
|
||||
qemu_coroutine_yield();
|
||||
g_assert(to_schedule[id] == NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -174,7 +174,7 @@ void qemu_bh_schedule(QEMUBH *bh)
|
||||
*/
|
||||
void qemu_bh_cancel(QEMUBH *bh)
|
||||
{
|
||||
bh->scheduled = 0;
|
||||
atomic_mb_set(&bh->scheduled, 0);
|
||||
}
|
||||
|
||||
/* This func is async.The bottom half will do the delete action at the finial
|
||||
|
||||
Reference in New Issue
Block a user