blob: 731d77d6e155de48fed65db977d2e83843465c06 [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>
David S. Miller8b4ad5e2006-01-09 21:38:23 -08006
Ingo Molnar408894e2006-01-09 15:59:20 -08007/*
8 * Mutexes - debugging helpers:
9 */
10
Ingo Molnar9a11b49a2006-07-03 00:24:33 -070011#define __DEBUG_MUTEX_INITIALIZER(lockname) \
12 , .magic = &lockname
Ingo Molnar408894e2006-01-09 15:59:20 -080013
Ingo Molnaref5d4702006-07-03 00:24:55 -070014#define mutex_init(mutex) \
15do { \
16 static struct lock_class_key __key; \
17 \
18 __mutex_init((mutex), #mutex, &__key); \
19} while (0)
Ingo Molnar408894e2006-01-09 15:59:20 -080020
Harvey Harrisonb3c97522008-02-13 15:03:15 -080021extern void mutex_destroy(struct mutex *lock);
Ingo Molnar408894e2006-01-09 15:59:20 -080022
Ingo Molnar408894e2006-01-09 15:59:20 -080023#endif