summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2003-07-13 01:22:21 +0000
committertruckman <truckman@FreeBSD.org>2003-07-13 01:22:21 +0000
commitf98596512043a2b2e8207da073f085954bc223a9 (patch)
tree717b3d174838551975ecc8e26f0d8c55fe89302c /sys/kern/kern_lock.c
parentd62f9caa290ab53c0c790392fb7353144dddceff (diff)
downloadFreeBSD-src-f98596512043a2b2e8207da073f085954bc223a9.zip
FreeBSD-src-f98596512043a2b2e8207da073f085954bc223a9.tar.gz
Extend the mutex pool implementation to permit the creation and use of
multiple mutex pools with different options and sizes. Mutex pools can be created with either the default sleep mutexes or with spin mutexes. A dynamically created mutex pool can now be destroyed if it is no longer needed. Create two pools by default, one that matches the existing pool that uses the MTX_NOWITNESS option that should be used for building higher level locks, and a new pool with witness checking enabled. Modify the users of the existing mutex pool to use the appropriate pool in the new implementation. Reviewed by: jhb
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 475ebaa..d765fb6 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -547,9 +547,9 @@ lockinit(lkp, prio, wmesg, timo, flags)
* XXX cleanup - make sure mtxpool is always initialized before
* this is ever called.
*/
- if (mtx_pool_valid) {
+ if (mtxpool_lockbuilder != NULL) {
mtx_lock(&lock_mtx);
- lkp->lk_interlock = mtx_pool_alloc();
+ lkp->lk_interlock = mtx_pool_alloc(mtxpool_lockbuilder);
mtx_unlock(&lock_mtx);
} else {
lkp->lk_interlock = &lock_mtx;
OpenPOWER on IntegriCloud