]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - tests/iothread.c
hw/rdma: Utilize ibv_reg_mr_iova for memory registration
[thirdparty/qemu.git] / tests / iothread.c
index 777d9eea4620e22661ffb2697e71653377fb4f69..13c9fdcd8df7f29f19fc5f8f05cdc53ee07b7d46 100644 (file)
@@ -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);