aboutsummaryrefslogtreecommitdiff
path: root/tests/iothread.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/iothread.c')
-rw-r--r--tests/iothread.c10
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);