summaryrefslogtreecommitdiffstats
path: root/04_exercise/rwlock/rwlock.h
diff options
context:
space:
mode:
authorStefan Zabka <zabkaste@hu-berlin.de>2020-06-12 00:05:28 +0200
committerStefan Zabka <zabkaste@hu-berlin.de>2020-06-12 00:05:28 +0200
commit200f22578700b82c5a2d2052c9fda0d9e431d25f (patch)
tree49ff00735c15d7bd5cfb23089159440b788ff193 /04_exercise/rwlock/rwlock.h
parentb9771b85d4f543af78465985e6350c0ca57f4c70 (diff)
downloadbetriebssysteme-200f22578700b82c5a2d2052c9fda0d9e431d25f.tar.gz
betriebssysteme-200f22578700b82c5a2d2052c9fda0d9e431d25f.zip
THIS SHIT WORKS
Diffstat (limited to '04_exercise/rwlock/rwlock.h')
-rw-r--r--04_exercise/rwlock/rwlock.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/04_exercise/rwlock/rwlock.h b/04_exercise/rwlock/rwlock.h
new file mode 100644
index 0000000..aa27f09
--- /dev/null
+++ b/04_exercise/rwlock/rwlock.h
@@ -0,0 +1,16 @@
+//
+// Created by stefan on 11.06.20.
+//
+
+#ifndef BETRIEBSYSTEME_RWLOCK_H
+#define BETRIEBSYSTEME_RWLOCK_H
+#include <stdatomic.h>
+
+static const char RW_WRITE_LOCKED = -1;
+static const char RW_UNLOCKED = 0;
+void rwLockWrite(atomic_char *lock);
+void rwUnlockWrite(atomic_char *lock);
+void rwLockRead(atomic_char *lock);
+void rwUnlockRead(atomic_char *lock);
+
+#endif // BETRIEBSYSTEME_RWLOCK_H