From e4b779c492e9ffbfce806ac49acae66ab264a7da Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 22 Jul 2014 18:57:51 -0700 Subject: Use generic atomics in more places --- include/rwlock.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'include') 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); -- cgit v1.2.3