- 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.
This commit is contained in:
John Baldwin 2000-10-20 07:28:00 +00:00
parent 36412d79b4
commit d8881ca31d

View File

@ -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;