aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/mutex.h
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-27 13:36:24 -0700
committerBrian Behlendorf <[email protected]>2010-08-27 14:23:48 -0700
commitd85e28ad69d87e63894308c34739da59420a582d (patch)
tree92ddd4121eb7f653a0ee5019ed55ef856c31056c /include/sys/mutex.h
parent2b3543025cb2e61c55b4ba79a524d10fe951e3be (diff)
Add MUTEX_NOT_HELD() function
Simply implement the missing MUTEX_NOT_HELD() function using the !MUTEX_HELD construct.
Diffstat (limited to 'include/sys/mutex.h')
-rw-r--r--include/sys/mutex.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/sys/mutex.h b/include/sys/mutex.h
index ce8c0f4e9..97f49cb2a 100644
--- a/include/sys/mutex.h
+++ b/include/sys/mutex.h
@@ -57,7 +57,8 @@ mutex_owned(kmutex_t *mp)
return (ACCESS_ONCE(mp->owner) == current_thread_info());
}
-#define MUTEX_HELD(mp) mutex_owned(mp)
+#define MUTEX_HELD(mp) mutex_owned(mp)
+#define MUTEX_NOT_HELD(mp) (!MUTEX_HELD(mp))
#undef mutex_init
#define mutex_init(mp, name, type, ibc) \
({ \
@@ -150,6 +151,7 @@ mutex_owner(kmutex_t *mp)
#define mutex_owned(mp) (mutex_owner(mp) == current)
#define MUTEX_HELD(mp) mutex_owned(mp)
+#define MUTEX_NOT_HELD(mp) (!MUTEX_HELD(mp))
/*
* The following functions must be a #define and not static inline.