summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2007-07-23 14:52:22 +0000
committerattilio <attilio@FreeBSD.org>2007-07-23 14:52:22 +0000
commitad75d346f79352d24838aa0cdb77a4325db296be (patch)
treed80bcc82e423b3ded1b8d5d8e0fc1b78e2b8f516 /sys/kern/kern_thread.c
parent4d894bfc82e354a4b3a56a12d5897b8f6f69d244 (diff)
downloadFreeBSD-src-ad75d346f79352d24838aa0cdb77a4325db296be.zip
FreeBSD-src-ad75d346f79352d24838aa0cdb77a4325db296be.tar.gz
Actually, KSE kernel bits locking is broken and can lead likely to
dangerous races. Fix this problems adding correct locking for the members of 'struct kse_upcall' and other struct proc/struct thread related members. For the moment, just leave ku_mflag and ku_flags "lazy" locked. While here, cleanup the code removing the function kse_GC() (unused), and merging upcall_link(), upcall_unlink(), upcall_stash() in their respective callers (static functions, very short and only called in one place). Reported by: pav Tested by: pav (on some pointyhat cluster nodes) Approved by: jeff Approved by: re Sponsorized by: NGX Italy (http://www.ngx.it)
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 91870d4..e06d18c 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -550,7 +550,9 @@ thread_unthread(struct thread *td)
KASSERT((p->p_numthreads == 1), ("Unthreading with >1 threads"));
#ifdef KSE
+ thread_lock(td);
upcall_remove(td);
+ thread_unlock(td);
p->p_flag &= ~(P_SA|P_HADTHREADS);
td->td_mailbox = NULL;
td->td_pflags &= ~(TDP_SA | TDP_CAN_UNBIND);
OpenPOWER on IntegriCloud