summaryrefslogtreecommitdiffstats
path: root/include/sys/mutex.h
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-11-15 15:04:02 -0800
committerBrian Behlendorf <[email protected]>2009-11-15 15:04:02 -0800
commit1273cf284b4e916fdf6dfbdf1fdb720d62738663 (patch)
tree819560faba1640ab56ef6cc5a49921192b290a6a /include/sys/mutex.h
parent05b48408fb8bc420908d93d97231bb6727b17e9a (diff)
Always use the generic mutex_destroy().
Diffstat (limited to 'include/sys/mutex.h')
-rw-r--r--include/sys/mutex.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/sys/mutex.h b/include/sys/mutex.h
index 596c15612..1eedd4565 100644
--- a/include/sys/mutex.h
+++ b/include/sys/mutex.h
@@ -59,17 +59,21 @@ mutex_owner(kmutex_t *mp)
__mutex_init((mp), #mp, &__key); \
})
+#undef mutex_destroy
+#define mutex_destroy(mp) \
+({ \
+ VERIFY(!MUTEX_HELD(mp)); \
+})
+
#define mutex_tryenter(mp) mutex_trylock(mp)
#define mutex_enter(mp) mutex_lock(mp)
#define mutex_exit(mp) mutex_unlock(mp)
+
#ifdef HAVE_GPL_ONLY_SYMBOLS
# define mutex_enter_nested(mp, sc) mutex_lock_nested(mp, sc)
#else
# define mutex_enter_nested(mp, sc) mutex_enter(mp)
-# ifdef CONFIG_DEBUG_MUTEXES
-# define mutex_destroy(mp) ((void)0)
-# endif /* CONFIG_DEBUG_MUTEXES */
#endif /* HAVE_GPL_ONLY_SYMBOLS */
#else /* HAVE_MUTEX_OWNER */