summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2000-12-13 00:17:05 +0000
committerjake <jake@FreeBSD.org>2000-12-13 00:17:05 +0000
commita4ad237eaa665b78919b8ff019591629b59df5e9 (patch)
tree43d22ede99071cd294fded182b591a4a3cb8d414 /sys/kern/kern_exit.c
parent825aa5c1b32389b54f15847261348e090c31b7fc (diff)
downloadFreeBSD-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/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 861f007..4d7c2b2 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -264,12 +264,12 @@ exit1(p, rv)
* Remove proc from allproc queue and pidhash chain.
* Place onto zombproc. Unlink from parent's child list.
*/
- lockmgr(&allproc_lock, LK_EXCLUSIVE, NULL, CURPROC);
+ ALLPROC_LOCK(AP_EXCLUSIVE);
LIST_REMOVE(p, p_list);
LIST_INSERT_HEAD(&zombproc, p, p_list);
LIST_REMOVE(p, p_hash);
- lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC);
+ ALLPROC_LOCK(AP_RELEASE);
/*
* We have to wait until after releasing this lock before
* changing p_stat. If we block on a mutex while waiting to
@@ -517,9 +517,9 @@ loop:
* Unlink it from its process group and free it.
*/
leavepgrp(p);
- lockmgr(&allproc_lock, LK_EXCLUSIVE, NULL, CURPROC);
+ ALLPROC_LOCK(AP_EXCLUSIVE);
LIST_REMOVE(p, p_list); /* off zombproc */
- lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC);
+ ALLPROC_LOCK(AP_RELEASE);
LIST_REMOVE(p, p_sibling);
if (--p->p_procsig->ps_refcnt == 0) {
OpenPOWER on IntegriCloud