diff --git a/src/util/threadpool.c b/src/util/threadpool.c index c16e2aff60..883d1e5bdd 100644 --- a/src/util/threadpool.c +++ b/src/util/threadpool.c @@ -258,7 +258,8 @@ void virThreadPoolFree(virThreadPoolPtr pool) virCondBroadcast(&pool->prioCond); } - ignore_value(virCondWait(&pool->quit_cond, &pool->mutex)); + if (pool->nWorkers > 0 || pool->nPrioWorkers > 0) + ignore_value(virCondWait(&pool->quit_cond, &pool->mutex)); while ((job = pool->jobList.head)) { pool->jobList.head = pool->jobList.head->next;