summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sx.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-03-06 23:13:15 +0000
committerjhb <jhb@FreeBSD.org>2001-03-06 23:13:15 +0000
commit84abec1e650a65db1216a54f1e07c83669defe0e (patch)
treedb3a3db9781dd22d4da6bafa95961a53dd381bca /sys/kern/kern_sx.c
parent8e10dd4dec2d9d4df647ee86cc9fd77f62452b6e (diff)
downloadFreeBSD-src-84abec1e650a65db1216a54f1e07c83669defe0e.zip
FreeBSD-src-84abec1e650a65db1216a54f1e07c83669defe0e.tar.gz
In order to avoid recursing on the backing mutex for sx locks in the
INVARIANTS case, define the actual KASSERT() in _SX_ASSERT_[SX]LOCKED macros that are used in the sx code itself and convert the SX_ASSERT_[SX]LOCKED macros to simple wrappers that grab the mutex for the duration of the check.
Diffstat (limited to 'sys/kern/kern_sx.c')
-rw-r--r--sys/kern/kern_sx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index c089147..a1c576f 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -136,7 +136,7 @@ sx_sunlock(struct sx *sx)
{
mtx_lock(&sx->sx_lock);
- SX_ASSERT_SLOCKED(sx);
+ _SX_ASSERT_SLOCKED(sx);
/* Release. */
sx->sx_cnt--;
@@ -161,7 +161,7 @@ sx_xunlock(struct sx *sx)
{
mtx_lock(&sx->sx_lock);
- SX_ASSERT_XLOCKED(sx);
+ _SX_ASSERT_XLOCKED(sx);
MPASS(sx->sx_cnt == -1);
/* Release. */
OpenPOWER on IntegriCloud