From a4ad237eaa665b78919b8ff019591629b59df5e9 Mon Sep 17 00:00:00 2001 From: jake 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_fork.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/kern_fork.c') diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index c71e94b..60171a5 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -285,7 +285,7 @@ fork1(p1, flags, procp) * If RFHIGHPID is set (used during system boot), do not allocate * low-numbered pids. */ - lockmgr(&allproc_lock, LK_EXCLUSIVE, NULL, CURPROC); + ALLPROC_LOCK(AP_EXCLUSIVE); trypid = nextpid + 1; if (flags & RFHIGHPID) { if (trypid < 10) { @@ -355,7 +355,7 @@ again: p2->p_pid = trypid; LIST_INSERT_HEAD(&allproc, p2, p_list); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); - lockmgr(&allproc_lock, LK_RELEASE, NULL, CURPROC); + ALLPROC_LOCK(AP_RELEASE); /* * Make a proc table entry for the new process. -- cgit v1.1