aboutsummaryrefslogtreecommitdiff
path: root/util/thread-pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/thread-pool.c')
-rw-r--r--util/thread-pool.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/thread-pool.c b/util/thread-pool.c
index 6fba913529..7c9cec57e3 100644
--- a/util/thread-pool.c
+++ b/util/thread-pool.c
@@ -165,6 +165,7 @@ static void thread_pool_completion_bh(void *opaque)
ThreadPool *pool = opaque;
ThreadPoolElement *elem, *next;
+ aio_context_acquire(pool->ctx);
restart:
QLIST_FOREACH_SAFE(elem, &pool->head, all, next) {
if (elem->state != THREAD_DONE) {
@@ -191,6 +192,7 @@ restart:
qemu_aio_unref(elem);
}
}
+ aio_context_release(pool->ctx);
}
static void thread_pool_cancel(BlockAIOCB *acb)