diff options
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r-- | sys/kern/kern_lock.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 3dde4b8..c7e9c84 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -38,7 +38,7 @@ * SUCH DAMAGE. * * @(#)kern_lock.c 8.18 (Berkeley) 5/21/95 - * $Id: kern_lock.c,v 1.24 1999/03/12 03:09:29 julian Exp $ + * $Id: kern_lock.c,v 1.25 1999/03/15 05:11:27 julian Exp $ */ #include "opt_lint.h" @@ -384,7 +384,8 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line) case LK_RELEASE: if (lkp->lk_exclusivecount != 0) { #if !defined(MAX_PERF) - if (pid != lkp->lk_lockholder) + if (lkp->lk_lockholder != pid && + lkp->lk_lockholder != LK_KERNPROC) panic("lockmgr: pid %d, not %s %d unlocking", pid, "exclusive lock holder", lkp->lk_lockholder); @@ -518,6 +519,21 @@ lockstatus(lkp) } /* + * Determine the number of holders of a lock. + */ +int +lockcount(lkp) + struct lock *lkp; +{ + int count; + + simple_lock(&lkp->lk_interlock); + count = lkp->lk_exclusivecount + lkp->lk_sharecount; + simple_unlock(&lkp->lk_interlock); + return (count); +} + +/* * Print out information about state of a lock. Used by VOP_PRINT * routines to display status about contained locks. */ |