blob: 4ac8b1977b73c53cc915b8f7ee29d87bdba8c23a [file] [log] [blame]
Ingo Molnar408894e2006-01-09 15:59:20 -08001#ifndef __LINUX_MUTEX_DEBUG_H
2#define __LINUX_MUTEX_DEBUG_H
3
David S. Miller8b4ad5e2006-01-09 21:38:23 -08004#include <linux/linkage.h>
Ingo Molnaref5d4702006-07-03 00:24:55 -07005#include <linux/lockdep.h>
Maarten Lankhorst040a0a32013-06-24 10:30:04 +02006#include <linux/debug_locks.h>
David S. Miller8b4ad5e2006-01-09 21:38:23 -08007
Ingo Molnar408894e2006-01-09 15:59:20 -08008/*
9 * Mutexes - debugging helpers:
10 */
11
Ingo Molnar9a11b49a2006-07-03 00:24:33 -070012#define __DEBUG_MUTEX_INITIALIZER(lockname) \
13 , .magic = &lockname
Ingo Molnar408894e2006-01-09 15:59:20 -080014
Ingo Molnaref5d4702006-07-03 00:24:55 -070015#define mutex_init(mutex) \
16do { \
17 static struct lock_class_key __key; \
18 \
19 __mutex_init((mutex), #mutex, &__key); \
20} while (0)
Ingo Molnar408894e2006-01-09 15:59:20 -080021
Harvey Harrisonb3c97522008-02-13 15:03:15 -080022extern void mutex_destroy(struct mutex *lock);
Ingo Molnar408894e2006-01-09 15:59:20 -080023
Ingo Molnar408894e2006-01-09 15:59:20 -080024#endif