]> git.proxmox.com Git - mirror_qemu.git/blobdiff - util/thread-pool.c
i386: Update new x86_apicid parsing rules with die_offset support
[mirror_qemu.git] / util / thread-pool.c
index ce6cd30193a8da51bd8b3a7f62bbaa9718918284..4ed9b89ab2d9c4e6d805ea47c2b21d16f20c8da9 100644 (file)
@@ -15,7 +15,6 @@
  * GNU GPL, version 2 or (at your option) any later version.
  */
 #include "qemu/osdep.h"
-#include "qemu-common.h"
 #include "qemu/queue.h"
 #include "qemu/thread.h"
 #include "qemu/coroutine.h"
@@ -188,6 +187,13 @@ restart:
             aio_context_release(pool->ctx);
             elem->common.cb(elem->common.opaque, elem->ret);
             aio_context_acquire(pool->ctx);
+
+            /* We can safely cancel the completion_bh here regardless of someone
+             * else having scheduled it meanwhile because we reenter the
+             * completion function anyway (goto restart).
+             */
+            qemu_bh_cancel(pool->completion_bh);
+
             qemu_aio_unref(elem);
             goto restart;
         } else {