diff options
author | Chris Robinson <[email protected]> | 2014-05-14 02:47:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-05-14 02:47:07 -0700 |
commit | 1d2504d12e996a4c1e8fe9785901db9a9e3b4d7c (patch) | |
tree | 51895ba97192cee1fccab44a838e4fa43d81a984 /include/rwlock.h | |
parent | 4454ae25c753388c529b937ae2ce0f47f06d16c4 (diff) |
Make RefCount a non-integer type
It should only be accessed through the appropriate functions to ensure proper
atomicity.
Diffstat (limited to 'include/rwlock.h')
-rw-r--r-- | include/rwlock.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/rwlock.h b/include/rwlock.h index 764940fa..c3a275e6 100644 --- a/include/rwlock.h +++ b/include/rwlock.h @@ -5,13 +5,13 @@ #include "atomic.h" typedef struct { - volatile RefCount read_count; - volatile RefCount write_count; + RefCount read_count; + RefCount write_count; volatile int read_lock; volatile int read_entry_lock; volatile int write_lock; } RWLock; -#define RWLOCK_STATIC_INITIALIZE { 0, 0, false, false, false } +#define RWLOCK_STATIC_INITIALIZE { STATIC_REFCOUNT_INIT(0), STATIC_REFCOUNT_INIT(0), false, false, false } void RWLockInit(RWLock *lock); void ReadLock(RWLock *lock); |