Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 1 | #ifndef __LINUX_MUTEX_DEBUG_H |
2 | #define __LINUX_MUTEX_DEBUG_H | ||||
3 | |||||
David S. Miller | 8b4ad5e | 2006-01-09 21:38:23 -0800 | [diff] [blame] | 4 | #include <linux/linkage.h> |
Ingo Molnar | ef5d470 | 2006-07-03 00:24:55 -0700 | [diff] [blame] | 5 | #include <linux/lockdep.h> |
Maarten Lankhorst | 040a0a3 | 2013-06-24 10:30:04 +0200 | [diff] [blame] | 6 | #include <linux/debug_locks.h> |
David S. Miller | 8b4ad5e | 2006-01-09 21:38:23 -0800 | [diff] [blame] | 7 | |
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 8 | /* |
9 | * Mutexes - debugging helpers: | ||||
10 | */ | ||||
11 | |||||
Ingo Molnar | 9a11b49a | 2006-07-03 00:24:33 -0700 | [diff] [blame] | 12 | #define __DEBUG_MUTEX_INITIALIZER(lockname) \ |
13 | , .magic = &lockname | ||||
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 14 | |
Ingo Molnar | ef5d470 | 2006-07-03 00:24:55 -0700 | [diff] [blame] | 15 | #define mutex_init(mutex) \ |
16 | do { \ | ||||
17 | static struct lock_class_key __key; \ | ||||
18 | \ | ||||
19 | __mutex_init((mutex), #mutex, &__key); \ | ||||
20 | } while (0) | ||||
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 21 | |
Harvey Harrison | b3c9752 | 2008-02-13 15:03:15 -0800 | [diff] [blame] | 22 | extern void mutex_destroy(struct mutex *lock); |
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 23 | |
Ingo Molnar | 408894e | 2006-01-09 15:59:20 -0800 | [diff] [blame] | 24 | #endif |