summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.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_fork.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_fork.c')
-rw-r--r--sys/kern/kern_fork.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index caefeff..c63a839 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -834,9 +834,15 @@ fork_exit(callout, arg, frame)
void *arg;
struct trapframe *frame;
{
- struct thread *td = curthread;
- struct proc *p = td->td_proc;
+ struct thread *td;
+ struct proc *p;
+ if ((td = PCPU_GET(deadthread))) {
+ PCPU_SET(deadthread, NULL);
+ thread_stash(td);
+ }
+ td = curthread;
+ p = td->td_proc;
td->td_kse->ke_oncpu = PCPU_GET(cpuid);
p->p_state = PRS_NORMAL;
/*
OpenPOWER on IntegriCloud