From 6157b69f4a4b26ea6991871e8aff43760a109452 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Sat, 28 Apr 2001 12:11:01 +0000 Subject: [PATCH] Instead of asserting that a mutex is not still locked after unlocking it, assert that the mutex is owned and not recursed prior to unlocking it. This should give a clearer diagnostic when a programming error is caught. --- sys/kern/kern_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index d1d591688fe..f5bb326fac8 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -238,8 +238,8 @@ debuglockmgr(lkp, flags, interlkp, p, name, file, line) mtx_lock(lkp->lk_interlock); if (flags & LK_INTERLOCK) { + mtx_assert(interlkp, MA_OWNED | MA_NOTRECURSED); mtx_unlock(interlkp); - mtx_assert(interlkp, MA_NOTOWNED); } extflags = (flags | lkp->lk_flags) & LK_EXTFLG_MASK;