--- /usr/src/sys/kern/kern_lock.c Fri Aug 5 22:59:10 2005 +++ src/sys/kern/kern_lock.c Wed Aug 31 02:17:00 2005 @@ -55,6 +55,7 @@ #include #include #endif +#include /* * Locking primitives implementation. @@ -379,6 +380,9 @@ } } else if (lkp->lk_flags & LK_SHARE_NONZERO) shareunlock(td, lkp, 1); + else + panic("lockmgr: thread %p unlocking unheld lock", thr); + if (lkp->lk_flags & LK_WAIT_NONZERO) wakeup((void *)lkp); break;