summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2000-11-22 07:42:04 +0000
committerjake <jake@FreeBSD.org>2000-11-22 07:42:04 +0000
commit0c0be4e82677a2d8fb49b7a70676bf359e7360b0 (patch)
treea0c32260edfde6d861e66b11172147608684043e /sys/kern/init_main.c
parent1b544875743d53491a096b0c757bf30ce73bb83b (diff)
downloadFreeBSD-src-0c0be4e82677a2d8fb49b7a70676bf359e7360b0.zip
FreeBSD-src-0c0be4e82677a2d8fb49b7a70676bf359e7360b0.tar.gz
Protect the following with a lockmgr lock:
allproc zombproc pidhashtbl proc.p_list proc.p_hash nextpid Reviewed by: jhb Obtained from: BSD/OS and netbsd
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index de702bc..c4d1767 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -405,10 +405,12 @@ proc0_post(void *dummy __unused)
* Now we can look at the time, having had a chance to verify the
* time from the file system. Pretend that proc0 started now.
*/
+ lockmgr(&allproc_lock, LK_SHARED, NULL, CURPROC);
LIST_FOREACH(p, &allproc, p_list) {
microtime(&p->p_stats->p_start);
p->p_runtime = 0;
}
+ lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC);
microuptime(&switchtime);
PCPU_SET(switchticks, ticks);
OpenPOWER on IntegriCloud