diff options
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); |