NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PR/55948 CVS commit: src/sys/kern



The following reply was made to PR kern/55948; it has been noted by GNATS.

From: "Taylor R Campbell" <riastradh%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc: 
Subject: PR/55948 CVS commit: src/sys/kern
Date: Sat, 23 Jan 2021 16:33:49 +0000

 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.
 


Home | Main Index | Thread Index | Old Index