summaryrefslogtreecommitdiff
path: root/include/linux/lglock.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-01-08 00:13:18 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-01-20 09:07:08 -0900
commitb33fc8298f7e13226b9895abc57c9bfce5e3fa2d (patch)
treea3d2a5a909b6372f7777c1c5c18cef5f81d123a9 /include/linux/lglock.h
parent7f4191a202ea4558ca2d5eb8a47daea33c9999c7 (diff)
bcache in userspace; userspace fsck
Diffstat (limited to 'include/linux/lglock.h')
-rw-r--r--include/linux/lglock.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/lglock.h b/include/linux/lglock.h
new file mode 100644
index 00000000..a9108bcd
--- /dev/null
+++ b/include/linux/lglock.h
@@ -0,0 +1,18 @@
+#ifndef __TOOLS_LINUX_LGLOCK_H
+#define __TOOLS_LINUX_LGLOCK_H
+
+#include <pthread.h>
+
+struct lglock {
+ pthread_mutex_t lock;
+};
+
+#define lg_lock_free(l) do {} while (0)
+#define lg_lock_init(l) pthread_mutex_init(&(l)->lock, NULL)
+
+#define lg_local_lock(l) pthread_mutex_lock(&(l)->lock)
+#define lg_local_unlock(l) pthread_mutex_unlock(&(l)->lock)
+#define lg_global_lock(l) pthread_mutex_lock(&(l)->lock)
+#define lg_global_unlock(l) pthread_mutex_unlock(&(l)->lock)
+
+#endif /* __TOOLS_LINUX_LGLOCK_H */