aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/sys/mutex.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h
index 1ff8d3521845..ff17f6e39efa 100644
--- a/sys/sys/mutex.h
+++ b/sys/sys/mutex.h
@@ -210,7 +210,7 @@ do { \
#ifdef INVARIANTS
#define MA_OWNED 1
#define MA_NOTOWNED 2
-#define mtx_assert(m, what) { \
+#define mtx_assert(m, what) do { \
switch ((what)) { \
case MA_OWNED: \
if (!mtx_owned((m))) \
@@ -225,7 +225,7 @@ do { \
default: \
panic("unknown mtx_assert at %s:%d", __FILE__, __LINE__); \
} \
-}
+} while(0)
#else /* INVARIANTS */
#define mtx_assert(m, what)
#endif /* INVARIANTS */