summaryrefslogtreecommitdiffstats
path: root/04_exercise/rwlock.h
diff options
context:
space:
mode:
authorStefan Zabka <zabkaste@hu-berlin.de>2020-06-22 16:43:42 +0200
committerStefan Zabka <zabkaste@hu-berlin.de>2020-06-22 16:43:42 +0200
commit239f248456ad00f894dc26dceefa968898738c9d (patch)
tree14d41af555b12c88401d8bb46bae9f4319497b62 /04_exercise/rwlock.h
parent021afcb8e4aa4fbc7905f527089c415108c86c75 (diff)
downloadbetriebssysteme-239f248456ad00f894dc26dceefa968898738c9d.tar.gz
betriebssysteme-239f248456ad00f894dc26dceefa968898738c9d.zip
Getting make to run
Diffstat (limited to '04_exercise/rwlock.h')
-rw-r--r--04_exercise/rwlock.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/04_exercise/rwlock.h b/04_exercise/rwlock.h
new file mode 100644
index 0000000..aa27f09
--- /dev/null
+++ b/04_exercise/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