summaryrefslogtreecommitdiffstats
path: root/04_exercise/rwlock/rwlock.h
diff options
context:
space:
mode:
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