diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-10-15 10:55:38 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-10-15 10:55:38 +0100 |
commit | 3779d1801166cc27b91f88366dd5bbae6b1c6dde (patch) | |
tree | ff205fb4a6f9318accca54c14e2516400391d430 | |
parent | 4a512a95bbca8f47b76bffd9c59b7d28297d86e1 (diff) | |
parent | 69de48445a0d6169f1e2a6c5bfab994e1c810e33 (diff) | |
download | qemu-3779d1801166cc27b91f88366dd5bbae6b1c6dde.zip |
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request
# gpg: Signature made Mon 14 Oct 2019 09:52:03 BST
# gpg: using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/block-pull-request:
test-bdrv-drain: fix iothread_join() hang
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | tests/iothread.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/iothread.c b/tests/iothread.c index 777d9eea46..13c9fdcd8d 100644 --- a/tests/iothread.c +++ b/tests/iothread.c @@ -55,10 +55,16 @@ static void *iothread_run(void *opaque) return NULL; } -void iothread_join(IOThread *iothread) +static void iothread_stop_bh(void *opaque) { + IOThread *iothread = opaque; + iothread->stopping = true; - aio_notify(iothread->ctx); +} + +void iothread_join(IOThread *iothread) +{ + aio_bh_schedule_oneshot(iothread->ctx, iothread_stop_bh, iothread); qemu_thread_join(&iothread->thread); qemu_cond_destroy(&iothread->init_done_cond); qemu_mutex_destroy(&iothread->init_done_lock); |