2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Taskmgr shutdown fixes

This commit is contained in:
Witold Kręcicki
2018-10-18 18:16:25 +00:00
parent 81a85070c5
commit d7be8afea5

View File

@@ -1180,6 +1180,15 @@ dispatch(isc__taskmgr_t *manager, int threadid) {
}
}
UNLOCK(manager->locks[queue]);
/*
* There might be other dispatchers waiting on empty tasks,
* wake them up.
*/
for (unsigned i=0; i < manager->workers; i++) {
LOCK(manager->locks[i]);
BROADCAST(&manager->work_available[i]);
UNLOCK(manager->locks[i]);
}
}
typedef struct st {
@@ -1421,8 +1430,10 @@ isc_taskmgr_destroy(isc_taskmgr_t **managerp) {
task != NULL;
task = NEXT(task, link)) {
LOCK(&task->lock);
if (task_shutdown(task))
push_readyq(manager, task, 0);
if (task_shutdown(task)) {
int queue = task->threadid % manager->queues;
push_readyq(manager, task, queue);
}
UNLOCK(&task->lock);
}
/*