From: Witold Kręcicki Date: Mon, 22 Oct 2018 12:26:27 +0000 (+0000) Subject: Post shutting down tasks always to manager 0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fffa3760d6d1b5c179a106952ee15ca323c3b2d;p=thirdparty%2Fbind9.git Post shutting down tasks always to manager 0 --- diff --git a/lib/isc/task.c b/lib/isc/task.c index d36143d32a1..9c1f769b8b3 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -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