]> Git Repo - qemu.git/blobdiff - iothread.c
block/nvme: Fix bdrv_refresh_filename()
[qemu.git] / iothread.c
index 2fb1cdf55d10b882c78276221a0d0caaeba388a2..e615b7ae52b2721fb80f6390c6cc30d78600023d 100644 (file)
@@ -63,7 +63,11 @@ static void *iothread_run(void *opaque)
     while (iothread->running) {
         aio_poll(iothread->ctx, true);
 
-        if (atomic_read(&iothread->worker_context)) {
+        /*
+         * We must check the running state again in case it was
+         * changed in previous aio_poll()
+         */
+        if (iothread->running && atomic_read(&iothread->worker_context)) {
             GMainLoop *loop;
 
             g_main_context_push_thread_default(iothread->worker_context);
This page took 0.022258 seconds and 4 git commands to generate.