diff options
author | jhb <jhb@FreeBSD.org> | 2000-10-20 07:28:00 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-10-20 07:28:00 +0000 |
commit | a08bf2eb0aa3b27be98171ac780d1e0bb0d9238e (patch) | |
tree | 950e833995f4f424684afeea572908a11b5478bc /sys | |
parent | f671832d7667351a66ab594f63d8cd4ef66e8e91 (diff) | |
download | FreeBSD-src-a08bf2eb0aa3b27be98171ac780d1e0bb0d9238e.zip FreeBSD-src-a08bf2eb0aa3b27be98171ac780d1e0bb0d9238e.tar.gz |
- machine/mutex.h -> sys/mutex.h
- The initial lock_mtx mutex used in the lockmgr code is initialized very
early, so use MUTEX_DECLARE() and MTX_COLD.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_lock.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 9265763..11237c0 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -46,10 +46,9 @@ #include <sys/kernel.h> #include <sys/lock.h> #include <sys/malloc.h> +#include <sys/mutex.h> #include <sys/systm.h> -#include <machine/mutex.h> - /* * Locking primitives implementation. * Locks provide shared/exclusive sychronization. @@ -81,7 +80,7 @@ extern int lock_nmtx; int lock_mtx_selector; struct mtx *lock_mtx_array; -struct mtx lock_mtx; +MUTEX_DECLARE(static, lock_mtx); static int acquire(struct lock *lkp, int extflags, int wanted); static int apause(struct lock *lkp, int flags); @@ -99,7 +98,7 @@ lockmgr_init(void *dummy __unused) * initialized in a call to lockinit(). */ if (lock_mtx_selector == 0) - mtx_init(&lock_mtx, "lockmgr", MTX_DEF); + mtx_init(&lock_mtx, "lockmgr", MTX_DEF | MTX_COLD); else { /* * This is necessary if (lock_nmtx == 1) and doesn't hurt @@ -550,7 +549,7 @@ lockinit(lkp, prio, wmesg, timo, flags) * so there's no reason to protect modification of * lock_mtx_selector or lock_mtx. */ - mtx_init(&lock_mtx, "lockmgr", MTX_DEF); + mtx_init(&lock_mtx, "lockmgr", MTX_DEF | MTX_COLD); lock_mtx_selector = 1; } lkp->lk_interlock = &lock_mtx; |