diff options
| author | 2014-01-20 21:19:27 +0000 | |
|---|---|---|
| committer | 2014-01-20 21:19:27 +0000 | |
| commit | 712e2ef1d075cfb59b85031fe4aaec60cc1e47a0 (patch) | |
| tree | 632f21bb409d9c4fb9be6a0c8ee0bb473f9ec7c7 /sys/kern/init_main.c | |
| parent | for the SHA256 file, output checksums in base64; ok espie@ (diff) | |
| download | wireguard-openbsd-712e2ef1d075cfb59b85031fe4aaec60cc1e47a0.tar.xz wireguard-openbsd-712e2ef1d075cfb59b85031fe4aaec60cc1e47a0.zip | |
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.c | 13 |
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(); |
