From: Ondřej Surý Date: Wed, 17 Jun 2026 19:16:50 +0000 (+0200) Subject: Run the work asynchronously when shutting down X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=17b8942efa173c2d4466128e17541cff449112e1;p=thirdparty%2Fbind9.git Run the work asynchronously when shutting down Instead of running the work directly, run it asynchronously to prevent dead-locks when then isc_work is scheduled from inside a lock and the job itself is using locking. --- diff --git a/lib/isc/work.c b/lib/isc/work.c index c70d512b2ef..69c751cf101 100644 --- a/lib/isc/work.c +++ b/lib/isc/work.c @@ -204,7 +204,8 @@ work_done(void *arg) { } static void -work_run(isc_work_t *work) { +work_run(void *arg) { + isc_work_t *work = arg; /* * The CAS *is* the tombstone check: whoever moves the item out * of WORK_QUEUED first — this worker or isc_work_cancel() — @@ -307,7 +308,7 @@ isc_work_enqueue(isc_loop_t *loop, isc_worklane_t lane, isc_work_cb cb, * remaining enqueue tasks and shutdown after, see * workthread_thread().) */ - work_run(work); + isc_async_run(loop, work_run, work); } else { (void)cds_wfcq_enqueue(&thread->qhead, &thread->qtail, &work->node);