summaryrefslogtreecommitdiff
path: root/include/linux/mutex.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-03-10 12:40:01 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-03-10 12:40:01 -0900
commit3bf874183a518cc1bf785d9944de05cf51a177d3 (patch)
tree65fb33f65a65996669fb96e5c746f6dd4d22d31c /include/linux/mutex.h
parentc3844b0b7ff75527a87f52229f15341c24c0d356 (diff)
update bcache sources
Diffstat (limited to 'include/linux/mutex.h')
-rw-r--r--include/linux/mutex.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index 964bd338..801f06e1 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -7,6 +7,9 @@ struct mutex {
pthread_mutex_t lock;
};
+#define DEFINE_MUTEX(mutexname) \
+ struct mutex mutexname = { .lock = PTHREAD_MUTEX_INITIALIZER }
+
#define mutex_init(l) pthread_mutex_init(&(l)->lock, NULL)
#define mutex_lock(l) pthread_mutex_lock(&(l)->lock)
#define mutex_trylock(l) (!pthread_mutex_trylock(&(l)->lock))