Module Name: src Committed By: martin Date: Mon Jan 25 14:12:50 UTC 2021
Modified Files: src/sys/kern [netbsd-9]: kern_threadpool.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1187): sys/kern/kern_threadpool.c: revision 1.23 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.15 -r1.15.6.1 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.