]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Run the work asynchronously when shutting down 12268/head
authorOndřej Surý <ondrej@isc.org>
Wed, 17 Jun 2026 19:16:50 +0000 (21:16 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 17 Jun 2026 20:29:51 +0000 (22:29 +0200)
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.

lib/isc/work.c

index c70d512b2ef7d4aaa9188853a2d5b0e14fa20c0b..69c751cf10167183315c6d89adadd16e1de371ea 100644 (file)
@@ -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);