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.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/thread-pool.c b/util/thread-pool.c
index 4ed9b89..d763cea 100644
--- a/util/thread-pool.c
+++ b/util/thread-pool.c
@@ -210,7 +210,7 @@ static void thread_pool_cancel(BlockAIOCB *acb)
trace_thread_pool_cancel(elem, elem->common.opaque);
- qemu_mutex_lock(&pool->lock);
+ QEMU_LOCK_GUARD(&pool->lock);
if (elem->state == THREAD_QUEUED &&
/* No thread has yet started working on elem. we can try to "steal"
* the item from the worker if we can get a signal from the
@@ -225,7 +225,6 @@ static void thread_pool_cancel(BlockAIOCB *acb)
elem->ret = -ECANCELED;
}
- qemu_mutex_unlock(&pool->lock);
}
static AioContext *thread_pool_get_aio_context(BlockAIOCB *acb)