提交 3b0bb65d 编写于 作者: M Michal Privoznik

threadpool: Don't wait on condition if pool has no workers

Pool creates new workers dynamically. However, it is possible
for a pool to have no workers. If we want to free that pool,
we don't want to wait on quit condition as it will never be
signaled.
上级 2d5046d3
......@@ -258,6 +258,7 @@ void virThreadPoolFree(virThreadPoolPtr pool)
virCondBroadcast(&pool->prioCond);
}
if (pool->nWorkers > 0 || pool->nPrioWorkers > 0)
ignore_value(virCondWait(&pool->quit_cond, &pool->mutex));
while ((job = pool->jobList.head)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册