diff options
author | ssouhlal <ssouhlal@FreeBSD.org> | 2005-09-02 15:56:01 +0000 |
---|---|---|
committer | ssouhlal <ssouhlal@FreeBSD.org> | 2005-09-02 15:56:01 +0000 |
commit | 6dfa271942b9c3d88bd20f34c0a4313e4dd59ac6 (patch) | |
tree | fef74b34d0e25675356cacf6f0b96f7f0f3cf0f5 /sys/kern/kern_lock.c | |
parent | 45954b5047007cc1ac0c3fe9d2b852b22b5aea29 (diff) | |
download | FreeBSD-src-6dfa271942b9c3d88bd20f34c0a4313e4dd59ac6.zip FreeBSD-src-6dfa271942b9c3d88bd20f34c0a4313e4dd59ac6.tar.gz |
Print out a warning and a backtrace if we try to unlock a lockmgr that
we do not hold.
Glanced at by: phk
MFC after: 3 days
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r-- | sys/kern/kern_lock.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index a0ac607..c53683c 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include <sys/stack.h> #include <sys/sysctl.h> #endif +#include <sys/kdb.h> /* * Locking primitives implementation. @@ -379,6 +380,12 @@ lockmgr(lkp, flags, interlkp, td) } } else if (lkp->lk_flags & LK_SHARE_NONZERO) shareunlock(td, lkp, 1); + else { + printf("lockmgr: thread %p unlocking unheld lock\n", + thr); + kdb_backtrace(); + } + if (lkp->lk_flags & LK_WAIT_NONZERO) wakeup((void *)lkp); break; |