aboutsummaryrefslogtreecommitdiffstats
path: root/include/rwlock.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-05-14 02:47:07 -0700
committerChris Robinson <[email protected]>2014-05-14 02:47:07 -0700
commit1d2504d12e996a4c1e8fe9785901db9a9e3b4d7c (patch)
tree51895ba97192cee1fccab44a838e4fa43d81a984 /include/rwlock.h
parent4454ae25c753388c529b937ae2ce0f47f06d16c4 (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.h6
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);