mutex-debug.h 473 B

123456789101112131415161718192021222324
  1. #ifndef __LINUX_MUTEX_DEBUG_H
  2. #define __LINUX_MUTEX_DEBUG_H
  3. #include <linux/linkage.h>
  4. #include <linux/lockdep.h>
  5. #include <linux/debug_locks.h>
  6. /*
  7. * Mutexes - debugging helpers:
  8. */
  9. #define __DEBUG_MUTEX_INITIALIZER(lockname) \
  10. , .magic = &lockname
  11. #define mutex_init(mutex) \
  12. do { \
  13. static struct lock_class_key __key; \
  14. \
  15. __mutex_init((mutex), #mutex, &__key); \
  16. } while (0)
  17. extern void mutex_destroy(struct mutex *lock);
  18. #endif