summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_rwlock.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2006-05-07 20:12:41 +0000
committertedu <tedu@openbsd.org>2006-05-07 20:12:41 +0000
commitf1ef728de1b8bb44b16bab7f65edda92d59fa017 (patch)
tree5ea7b69f6411147c8afec0ce11d1297c9c2fccab /sys/kern/kern_rwlock.c
parentremove drain hooks from pool. (diff)
downloadwireguard-openbsd-f1ef728de1b8bb44b16bab7f65edda92d59fa017.tar.xz
wireguard-openbsd-f1ef728de1b8bb44b16bab7f65edda92d59fa017.zip
add a name to rwlock so that we can tell where procs are getting stuck
without breaking into ddb. doubles the size of rwlock [1], but moving forward this really helps. ok/tested pedro fgsch millert krw [1 - next person to add a field to this struct gets whipped with a wet noodle]
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r--sys/kern/kern_rwlock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index 1a648aa831b..4c750a2f2f6 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_rwlock.c,v 1.6 2006/04/20 14:36:24 pedro Exp $ */
+/* $OpenBSD: kern_rwlock.c,v 1.7 2006/05/07 20:12:41 tedu Exp $ */
/*
* Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org>
@@ -198,9 +198,10 @@ rw_exit_diag(struct rwlock *rwl, int owner)
#endif
void
-rw_init(struct rwlock *rwl)
+rw_init(struct rwlock *rwl, const char *name)
{
rwl->rwl_owner = 0;
+ rwl->rwl_name = name;
}
/*
@@ -230,7 +231,7 @@ retry:
rw_enter_diag(rwl, flags);
- if ((error = tsleep(rwl, prio, "rwlock", 0)) != 0)
+ if ((error = tsleep(rwl, prio, rwl->rwl_name, 0)) != 0)
return (error);
if (flags & RW_SLEEPFAIL)
return (EAGAIN);