diff options
author | Chris Robinson <[email protected]> | 2014-07-22 18:57:51 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-07-22 18:57:51 -0700 |
commit | e4b779c492e9ffbfce806ac49acae66ab264a7da (patch) | |
tree | 0ccf89e9157fe9dfa6410192d3ff4897ed1ce4bc /include | |
parent | a3b1d4a5e20fade26bdfe2b964d8d363aac2acc3 (diff) |
Use generic atomics in more places
Diffstat (limited to 'include')
-rw-r--r-- | include/rwlock.h | 10 |
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); |