diff options
author | jake <jake@FreeBSD.org> | 2000-12-13 00:17:05 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2000-12-13 00:17:05 +0000 |
commit | a4ad237eaa665b78919b8ff019591629b59df5e9 (patch) | |
tree | 43d22ede99071cd294fded182b591a4a3cb8d414 /sys/vm/vm_glue.c | |
parent | 825aa5c1b32389b54f15847261348e090c31b7fc (diff) | |
download | FreeBSD-src-a4ad237eaa665b78919b8ff019591629b59df5e9.zip FreeBSD-src-a4ad237eaa665b78919b8ff019591629b59df5e9.tar.gz |
- Change the allproc_lock to use a macro, ALLPROC_LOCK(how), instead
of explicit calls to lockmgr. Also provides macros for the flags
pased to specify shared, exclusive or release which map to the
lockmgr flags. This is so that the use of lockmgr can be easily
replaced with optimized reader-writer locks.
- Add some locking that I missed the first time.
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r-- | sys/vm/vm_glue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 3bc4d11..b1da607 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -360,7 +360,7 @@ loop: pp = NULL; ppri = INT_MIN; - lockmgr(&allproc_lock, LK_SHARED, NULL, CURPROC); + ALLPROC_LOCK(AP_SHARED); for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { mtx_enter(&sched_lock, MTX_SPIN); if (p->p_stat == SRUN && @@ -383,7 +383,7 @@ loop: } mtx_exit(&sched_lock, MTX_SPIN); } - lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC); + ALLPROC_LOCK(AP_RELEASE); /* * Nothing to do, back to sleep. @@ -443,7 +443,7 @@ int action; outp = outp2 = NULL; outpri = outpri2 = INT_MIN; - lockmgr(&allproc_lock, LK_SHARED, NULL, CURPROC); + ALLPROC_LOCK(AP_SHARED); retry: for (p = allproc.lh_first; p != 0; p = p->p_list.le_next) { struct vmspace *vm; @@ -516,7 +516,7 @@ retry: } } } - lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC); + ALLPROC_LOCK(AP_RELEASE); /* * If we swapped something out, and another process needed memory, * then wakeup the sched process. |