summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-01-20 21:19:29 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-01-20 21:19:29 +0000
commitee0ecd963da884228886664033fd7694a2eb8316 (patch)
tree52a9fc57aabaf3a0c1918697e14b24bc5f30528e /sys/kern/init_main.c
parentd97b363c4b36ac6fd5d7bd23bce2badd8549c7ee (diff)
Threads can't be zombies, only processes, so change zombproc to zombprocess,
make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes. ok tedu@
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 14dff21a4d4..7e35cf205d2 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.202 2014/01/19 23:52:54 deraadt Exp $ */
+/* $OpenBSD: init_main.c,v 1.203 2014/01/20 21:19:27 guenther Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -266,6 +266,7 @@ main(void *framep)
TAILQ_INSERT_TAIL(&process0.ps_threads, p, p_thr_link);
process0.ps_refcnt = 1;
p->p_p = pr = &process0;
+ LIST_INSERT_HEAD(&allprocess, pr, ps_list);
/* Set the default routing table/domain. */
process0.ps_rtableid = 0;
@@ -492,10 +493,12 @@ main(void *framep)
* munched in mi_switch() after the time got set.
*/
nanotime(&boottime);
- LIST_FOREACH(p, &allproc, p_list) {
- p->p_p->ps_start = boottime;
- nanouptime(&p->p_cpu->ci_schedstate.spc_runtime);
- timespecclear(&p->p_rtime);
+ LIST_FOREACH(pr, &allprocess, ps_list) {
+ pr->ps_start = boottime;
+ TAILQ_FOREACH(p, &pr->ps_threads, p_thr_link) {
+ nanouptime(&p->p_cpu->ci_schedstate.spc_runtime);
+ timespecclear(&p->p_rtime);
+ }
}
uvm_swap_init();