summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-12-10 02:33:45 +0000
committerjulian <julian@FreeBSD.org>2002-12-10 02:33:45 +0000
commit9868d96f1fab28e828ad309a400539d072e1da2d (patch)
treeb7b4d7891168c36af86fd5540478865532fe8977 /sys/kern/kern_synch.c
parent9349f701144f7b1af93f420305e9cbf99727d7ed (diff)
downloadFreeBSD-src-9868d96f1fab28e828ad309a400539d072e1da2d.zip
FreeBSD-src-9868d96f1fab28e828ad309a400539d072e1da2d.tar.gz
Unbreak the KSE code. Keep track of zobie threads using the Per-CPU storage
during the context switch. Rearrange thread cleanups to avoid problems with Giant. Clean threads when freed or when recycled. Approved by: re (jhb)
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index 66b3411..3f5b01d 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -540,6 +540,14 @@ mi_switch(void)
*/
if (td->td_switchin)
td->td_switchin();
+
+ /*
+ * If the last thread was exiting, finish cleaning it up.
+ */
+ if ((td = PCPU_GET(deadthread))) {
+ PCPU_SET(deadthread, NULL);
+ thread_stash(td);
+ }
}
/*
OpenPOWER on IntegriCloud