Post shutting down tasks always to manager 0

This commit is contained in:
Witold Kręcicki
2018-10-22 12:26:27 +00:00
parent c416389d32
commit 669a694d3b

View File

@@ -1391,17 +1391,21 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp) {
/*
* Post shutdown event(s) to every task (if they haven't already been
* posted).
* posted). To make things easier post idle tasks to worker 0.
*/
LOCK(&manager->queues[0].lock);
for (task = HEAD(manager->tasks);
task != NULL;
task = NEXT(task, link)) {
LOCK(&task->lock);
if (task_shutdown(task)) {
push_readyq(manager, task, task->threadid);
task->threadid = 0;
push_readyq(manager, task, 0);
}
UNLOCK(&task->lock);
}
UNLOCK(&manager->queues[0].lock);
/*
* Wake up any sleeping workers. This ensures we get work done if
* there's work left to do, and if there are already no tasks left