aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_rwlock.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2017-02-17 05:39:40 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2017-02-17 05:39:40 +0000
commitffd5c94c4fc333e76f19571a02c6c704177c596d (patch)
treef9ae906cef81d0de13ae7855e51d8fb09858159e /sys/kern/kern_rwlock.c
parent7a465c285fb94b892496ed14ac331f45944f420c (diff)
downloadsrc-ffd5c94c4fc333e76f19571a02c6c704177c596d.tar.gz
src-ffd5c94c4fc333e76f19571a02c6c704177c596d.zip
locks: let primitives for modules unlock without always goging to the slsow path
It is only needed if the LOCK_PROFILING is enabled. It has to always check if the lock is about to be released which requires an avoidable read if the option is not specified..
Notes
Notes: svn path=/head/; revision=313855
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r--sys/kern/kern_rwlock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index fcb7d00c3d68..bf74b6710499 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -341,7 +341,11 @@ _rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line)
LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file,
line);
+#ifdef LOCK_PROFILING
_rw_wunlock_hard(rw, (uintptr_t)curthread, file, line);
+#else
+ __rw_wunlock(rw, curthread, file, line);
+#endif
TD_LOCKS_DEC(curthread);
}