summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_rwlock.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2019-11-12 07:51:46 +0000
committermpi <mpi@openbsd.org>2019-11-12 07:51:46 +0000
commit32e3b82bee1d054cbe38a854155c3b93a4f90a5e (patch)
tree07dc3e24a9398ed9e494de2c40a5f54a53a16205 /sys/kern/kern_rwlock.c
parentConvert tsleep(9) that wait for a multiple of `hz' to tsleep_nsec(9). (diff)
downloadwireguard-openbsd-32e3b82bee1d054cbe38a854155c3b93a4f90a5e.tar.xz
wireguard-openbsd-32e3b82bee1d054cbe38a854155c3b93a4f90a5e.zip
Only check if the current thread has the lock in rw_assert_unlocked(9).
With this semantic change it is now possible to use a similar assert for both mutexes and rwlocks as required by the vm_map_assert_lock() diff. ok sashan@
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r--sys/kern/kern_rwlock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index 53439db85a5..54c3ad80529 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_rwlock.c,v 1.40 2019/07/16 01:40:49 jsg Exp $ */
+/* $OpenBSD: kern_rwlock.c,v 1.41 2019/11/12 07:51:46 mpi Exp $ */
/*
* Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org>
@@ -400,7 +400,7 @@ rw_assert_unlocked(struct rwlock *rwl)
if (panicstr || db_active)
return;
- if (rwl->rwl_owner != 0L)
+ if (RW_PROC(curproc) == RW_PROC(rwl->rwl_owner))
panic("%s: lock held", rwl->rwl_name);
}
#endif