summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-07-14 03:43:33 +0000
committerjulian <julian@FreeBSD.org>2002-07-14 03:43:33 +0000
commitd84464f213f9ba21a322886ecef90d13e9d43b74 (patch)
treeaafccf41b7ab2599852d32b259154da2899a2107 /sys/kern/kern_fork.c
parent8dcca6c13311debeaa8c8fd0fee178622bc65cd9 (diff)
downloadFreeBSD-src-d84464f213f9ba21a322886ecef90d13e9d43b74.zip
FreeBSD-src-d84464f213f9ba21a322886ecef90d13e9d43b74.tar.gz
Thinking about it I came to the conclusion that the KSE states were incorrectly
formulated. The correct states should be: IDLE: On the idle KSE list for that KSEG RUNQ: Linked onto the system run queue. THREAD: Attached to a thread and slaved to whatever state the thread is in. This means that most places where we were adjusting kse state can go away as it is just moving around because the thread is.. The only places we need to adjust the KSE state is in transition to and from the idle and run queues. Reviewed by: jhb@freebsd.org
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index d5fd231..77481ca 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -510,11 +510,10 @@ again:
/* Set up the thread as an active thread (as if runnable). */
TAILQ_REMOVE(&kg2->kg_iq, ke2, ke_kgrlist);
kg2->kg_idle_kses--;
- ke2->ke_state = KES_UNQUEUED;
+ ke2->ke_state = KES_THREAD;
ke2->ke_thread = td2;
td2->td_kse = ke2;
td2->td_flags &= ~TDF_UNBOUND; /* For the rest of this syscall. */
-KASSERT((ke2->ke_kgrlist.tqe_next != ke2), ("linked to self!"));
/* note.. XXXKSE no pcb or u-area yet */
@@ -835,7 +834,6 @@ fork_exit(callout, arg, frame)
td->td_kse->ke_oncpu = PCPU_GET(cpuid);
p->p_state = PRS_NORMAL;
td->td_state = TDS_RUNNING; /* Already done in switch() on 386. */
- td->td_kse->ke_state = KES_RUNNING;
/*
* Finish setting up thread glue. We need to initialize
* the thread into a td_critnest=1 state. Some platforms
OpenPOWER on IntegriCloud