diff options
author | jake <jake@FreeBSD.org> | 2000-11-22 07:42:04 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2000-11-22 07:42:04 +0000 |
commit | 0c0be4e82677a2d8fb49b7a70676bf359e7360b0 (patch) | |
tree | a0c32260edfde6d861e66b11172147608684043e /sys/vm/vm_glue.c | |
parent | 1b544875743d53491a096b0c757bf30ce73bb83b (diff) | |
download | FreeBSD-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/vm/vm_glue.c')
-rw-r--r-- | sys/vm/vm_glue.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 82e22ba..3c9e941 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -360,6 +360,7 @@ loop: pp = NULL; ppri = INT_MIN; + lockmgr(&allproc_lock, LK_SHARED, NULL, CURPROC); for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { if (p->p_stat == SRUN && (p->p_flag & (P_INMEM | P_SWAPPING)) == 0) { @@ -380,6 +381,7 @@ loop: } } } + lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC); /* * Nothing to do, back to sleep. @@ -439,6 +441,7 @@ int action; outp = outp2 = NULL; outpri = outpri2 = INT_MIN; + lockmgr(&allproc_lock, LK_SHARED, NULL, CURPROC); retry: for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { struct vmspace *vm; @@ -504,6 +507,7 @@ retry: } } } + lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC); /* * If we swapped something out, and another process needed memory, * then wakeup the sched process. |