summaryrefslogtreecommitdiff
path: root/kern/turnstile.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-09-01 23:58:41 +0200
committerRichard Braun <rbraun@sceen.net>2017-09-02 15:25:37 +0200
commitd18d0e85596f90e0bd597b33d58209d0b3973c95 (patch)
tree6c3472f59cf64244ab86d2fc13b220b1c8f61165 /kern/turnstile.h
parent897ad6a062ea2a32a2759613608faf3271211832 (diff)
Make assert have no side effects
This makes sure symbols referenced by assert uses may not be generated if unused. The recently introduced __unused macro is used to suppress compiler warnings resulting from this change.
Diffstat (limited to 'kern/turnstile.h')
-rw-r--r--kern/turnstile.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/kern/turnstile.h b/kern/turnstile.h
index e7b4a5e..f7ba084 100644
--- a/kern/turnstile.h
+++ b/kern/turnstile.h
@@ -43,8 +43,6 @@ struct turnstile;
*/
struct turnstile_td;
-#define turnstile_td_assert_lock(td) spinlock_assert_locked(&(td)->lock)
-
/*
* Initialize turnstile thread data.
*/
@@ -62,6 +60,12 @@ turnstile_td_init(struct turnstile_td *td)
* Turnstile thread data locking functions.
*/
+static inline bool
+turnstile_td_locked(struct turnstile_td *td)
+{
+ return spinlock_locked(&(td)->lock);
+}
+
static inline void
turnstile_td_lock(struct turnstile_td *td)
{