summaryrefslogtreecommitdiff
path: root/include/linux/mutex-debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mutex-debug.h')
-rw-r--r--include/linux/mutex-debug.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/mutex-debug.h b/include/linux/mutex-debug.h
new file mode 100644
index 000000000..4ac8b1977
--- /dev/null
+++ b/include/linux/mutex-debug.h
@@ -0,0 +1,24 @@
+#ifndef __LINUX_MUTEX_DEBUG_H
+#define __LINUX_MUTEX_DEBUG_H
+
+#include <linux/linkage.h>
+#include <linux/lockdep.h>
+#include <linux/debug_locks.h>
+
+/*
+ * Mutexes - debugging helpers:
+ */
+
+#define __DEBUG_MUTEX_INITIALIZER(lockname) \
+ , .magic = &lockname
+
+#define mutex_init(mutex) \
+do { \
+ static struct lock_class_key __key; \
+ \
+ __mutex_init((mutex), #mutex, &__key); \
+} while (0)
+
+extern void mutex_destroy(struct mutex *lock);
+
+#endif