diff options
-rw-r--r-- | sys/kern/kern_lock.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index c53683c..12c0d9c 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -526,8 +526,13 @@ lockstatus(lkp, td) struct thread *td; { int lock_type = 0; + int interlocked; - mtx_lock(lkp->lk_interlock); + if (!kdb_active) { + interlocked = 1; + mtx_lock(lkp->lk_interlock); + } else + interlocked = 0; if (lkp->lk_exclusivecount != 0) { if (td == NULL || lkp->lk_lockholder == td) lock_type = LK_EXCLUSIVE; @@ -535,7 +540,8 @@ lockstatus(lkp, td) lock_type = LK_EXCLOTHER; } else if (lkp->lk_sharecount != 0) lock_type = LK_SHARED; - mtx_unlock(lkp->lk_interlock); + if (interlocked) + mtx_unlock(lkp->lk_interlock); return (lock_type); } |