diff options
author | Stefan Zabka <zabkaste@hu-berlin.de> | 2020-06-22 16:43:42 +0200 |
---|---|---|
committer | Stefan Zabka <zabkaste@hu-berlin.de> | 2020-06-22 16:43:42 +0200 |
commit | 239f248456ad00f894dc26dceefa968898738c9d (patch) | |
tree | 14d41af555b12c88401d8bb46bae9f4319497b62 /04_exercise/rwlock.h | |
parent | 021afcb8e4aa4fbc7905f527089c415108c86c75 (diff) | |
download | betriebssysteme-239f248456ad00f894dc26dceefa968898738c9d.tar.gz betriebssysteme-239f248456ad00f894dc26dceefa968898738c9d.zip |
Getting make to run
Diffstat (limited to '04_exercise/rwlock.h')
-rw-r--r-- | 04_exercise/rwlock.h | 16 |
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 |