From c0c255709081ed31ff044179c49ca7e8c6abb162 Mon Sep 17 00:00:00 2001 From: Jake Burkholder Date: Wed, 13 Dec 2000 00:17:05 +0000 Subject: - 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. --- sys/kern/kern_exit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/kern/kern_exit.c') diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 861f00778285..4d7c2b20bc74 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) { -- cgit v1.2.3