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_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 c71e94b96322..60171a5a854a 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.2.3