aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-22 18:57:51 -0700
committerChris Robinson <[email protected]>2014-07-22 18:57:51 -0700
commite4b779c492e9ffbfce806ac49acae66ab264a7da (patch)
tree0ccf89e9157fe9dfa6410192d3ff4897ed1ce4bc /include
parenta3b1d4a5e20fade26bdfe2b964d8d363aac2acc3 (diff)
Use generic atomics in more places
Diffstat (limited to 'include')
-rw-r--r--include/rwlock.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/rwlock.h b/include/rwlock.h
index f2a8feab..158a0670 100644
--- a/include/rwlock.h
+++ b/include/rwlock.h
@@ -11,11 +11,13 @@ extern "C" {
typedef struct {
RefCount read_count;
RefCount write_count;
- volatile int read_lock;
- volatile int read_entry_lock;
- volatile int write_lock;
+ ATOMIC(int) read_lock;
+ ATOMIC(int) read_entry_lock;
+ ATOMIC(int) write_lock;
} RWLock;
-#define RWLOCK_STATIC_INITIALIZE { ATOMIC_INIT_STATIC(0), ATOMIC_INIT_STATIC(0), false, false, false }
+#define RWLOCK_STATIC_INITIALIZE { ATOMIC_INIT_STATIC(0), ATOMIC_INIT_STATIC(0), \
+ ATOMIC_INIT_STATIC(false), ATOMIC_INIT_STATIC(false), \
+ ATOMIC_INIT_STATIC(false) }
void RWLockInit(RWLock *lock);
void ReadLock(RWLock *lock);