diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2007-05-13 04:52:33 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2007-05-13 04:52:33 +0000 |
commit | b2b9c262e492b6115277f7ee3ef96e3b6e4c77c2 (patch) | |
tree | a55855d59dce06f3f83e135753332369bfa01fd9 /sys/kern/kern_rwlock.c | |
parent | cbd9291fde3dfb7a14a5d1c2f2df0d274ce95734 (diff) |
print lock name in some panic messages so we know what's up
ok krw marco pedro
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r-- | sys/kern/kern_rwlock.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index 0a2bca5a861..0df33c9008b 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_rwlock.c,v 1.12 2007/05/04 13:21:03 art Exp $ */ +/* $OpenBSD: kern_rwlock.c,v 1.13 2007/05/13 04:52:32 tedu Exp $ */ /* * Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org> @@ -148,16 +148,19 @@ rw_enter_diag(struct rwlock *rwl, int flags) case RW_WRITE: case RW_READ: if (RW_PROC(curproc) == RW_PROC(rwl->rwl_owner)) - panic("rw_enter: locking against myself"); + panic("rw_enter: %s locking against myself", + rwl->rwl_name); break; case RW_DOWNGRADE: /* * If we're downgrading, we must hold the write lock. */ if ((rwl->rwl_owner & RWLOCK_WRLOCK) == 0) - panic("rw_enter: downgrade of non-write lock"); + panic("rw_enter: %s downgrade of non-write lock", + rwl->rwl_name); if (RW_PROC(curproc) != RW_PROC(rwl->rwl_owner)) - panic("rw_enter: downgrade, not holder"); + panic("rw_enter: %s downgrade, not holder", + rwl->rwl_name); break; default: |