summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1999-01-08 17:31:30 +0000
committereivind <eivind@FreeBSD.org>1999-01-08 17:31:30 +0000
commita8dc66f457be84eefbe16e70c901ceb11137ba65 (patch)
treee5747f527c552fa90334c779c047697b372582fb /sys/kern/kern_lock.c
parent1c69824749ed0aa6efce159d39ab3f17fc9e25f2 (diff)
downloadFreeBSD-src-a8dc66f457be84eefbe16e70c901ceb11137ba65.zip
FreeBSD-src-a8dc66f457be84eefbe16e70c901ceb11137ba65.tar.gz
Split DIAGNOSTIC -> DIAGNOSTIC, INVARIANTS, and INVARIANT_SUPPORT as
discussed on -hackers. Introduce 'KASSERT(assertion, ("panic message", args))' for simple check + panic. Reviewed by: msmith
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index f411f14..0bf31d0 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.19 1998/04/17 04:53:44 bde Exp $
+ * $Id: kern_lock.c,v 1.20 1998/11/26 18:50:23 eivind Exp $
*/
#include "opt_lint.h"
@@ -83,14 +83,7 @@ sharelock(struct lock *lkp, int incr) {
static LOCK_INLINE void
shareunlock(struct lock *lkp, int decr) {
-#if defined(DIAGNOSTIC)
- if (lkp->lk_sharecount < decr)
-#if defined(DDB)
- Debugger("shareunlock: count < decr");
-#else
- panic("shareunlock: count < decr");
-#endif
-#endif
+ KASSERT(lkp->lk_sharecount >= decr, ("shareunlock: count < decr"));
if (lkp->lk_sharecount == decr) {
lkp->lk_flags &= ~LK_SHARE_NONZERO;
OpenPOWER on IntegriCloud