summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sx.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-10-24 14:18:33 +0000
committerjhb <jhb@FreeBSD.org>2001-10-24 14:18:33 +0000
commitdb9a37a27ac55295c0d14f5f452955bfc74b1cef (patch)
treea6a73c42b375fd5076ba6b31a0cc71046c8cdbaf /sys/kern/kern_sx.c
parenta6a7b0b031fec270567d2b976e077fa5db6e1d74 (diff)
downloadFreeBSD-src-db9a37a27ac55295c0d14f5f452955bfc74b1cef.zip
FreeBSD-src-db9a37a27ac55295c0d14f5f452955bfc74b1cef.tar.gz
Fix this to actually compile in the !INVARIANTS case.
Reported by: Maxime Henrion <mux@qualys.com>
Diffstat (limited to 'sys/kern/kern_sx.c')
-rw-r--r--sys/kern/kern_sx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c
index 5408af4..994e584 100644
--- a/sys/kern/kern_sx.c
+++ b/sys/kern/kern_sx.c
@@ -48,6 +48,10 @@ struct lock_class lock_class_sx = {
LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE
};
+#ifndef INVARIANTS
+#define _sx_assert(sx, what, file, line)
+#endif
+
void
sx_init(struct sx *sx, const char *description)
{
@@ -294,6 +298,10 @@ _sx_downgrade(struct sx *sx, const char *file, int line)
}
#ifdef INVARIANT_SUPPORT
+#ifndef INVARIANTS
+#undef _sx_assert
+#endif
+
/*
* In the non-WITNESS case, sx_assert() can only detect that at least
* *some* thread owns an slock, but it cannot guarantee that *this*
OpenPOWER on IntegriCloud