Module Name: src Committed By: riastradh Date: Sat Jan 23 16:33:49 UTC 2021
Modified Files: src/sys/kern: kern_threadpool.c Log Message: threadpool(9): Fix synchronization between cancel and dispatch. - threadpool_cancel_job_async tried to prevent threadpool_dispatcher_thread from taking the job by setting job->job_thread = NULL and then removing the job from the queue. - But threadpool_cancel_job_async didn't notice job->job_thread is null until after it also removes the job from the queue => double-remove, *boom*. The solution is to teach threadpool_dispatcher_thread to wait until it has acquired the job lock to test whether job->job_thread is still valid before it decides to remove the job from the queue. Fixes PR kern/55948. XXX pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/sys/kern/kern_threadpool.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.