summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_fork.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_fork.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_fork.c')
-rw-r--r--sys/kern/kern_fork.c4
1 files changed, 2 insertions, 2 deletions
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.
OpenPOWER on IntegriCloud