summaryrefslogtreecommitdiff
path: root/sys/include/ape/qlock.h
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 16:47:56 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 16:47:56 +0300
commitc558a99e0be506a9abdf677f0ca4490644e05fc1 (patch)
tree17aef678ad05a32ef96ce8385703cb3fe089a5c7 /sys/include/ape/qlock.h
parente5888a1ffdae813d7575f5fb02275c6bb07e5199 (diff)
Import sources from 2011-03-30 iso image - sys/include
Diffstat (limited to 'sys/include/ape/qlock.h')
-rwxr-xr-xsys/include/ape/qlock.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/sys/include/ape/qlock.h b/sys/include/ape/qlock.h
new file mode 100755
index 000000000..efaef0401
--- /dev/null
+++ b/sys/include/ape/qlock.h
@@ -0,0 +1,41 @@
+#ifndef _PLAN9_SOURCE
+ This header file is an extension to ANSI/POSIX
+#endif
+
+#ifndef __QLOCK_H_
+#define __QLOCK_H_
+#pragma lib "/$M/lib/ape/lib9.a"
+
+#include <u.h>
+#include <lock.h>
+
+typedef struct QLp QLp;
+struct QLp
+{
+ int inuse;
+ QLp *next;
+ char state;
+};
+
+typedef
+struct QLock
+{
+ Lock lock;
+ int locked;
+ QLp *head;
+ QLp *tail;
+} QLock;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void qlock(QLock*);
+extern void qunlock(QLock*);
+extern int canqlock(QLock*);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif