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.
}
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() —
* 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);