diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/atomic.c | 6 | ||||
-rw-r--r-- | common/rwlock.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/common/atomic.c b/common/atomic.c index 02bbf066..95b8f835 100644 --- a/common/atomic.c +++ b/common/atomic.c @@ -4,8 +4,10 @@ #include "atomic.h" -extern inline RefCount IncrementRef(volatile RefCount *ptr); -extern inline RefCount DecrementRef(volatile RefCount *ptr); +extern inline void InitRef(volatile RefCount *ptr, uint value); +extern inline uint ReadRef(volatile RefCount *ptr); +extern inline uint IncrementRef(volatile RefCount *ptr); +extern inline uint DecrementRef(volatile RefCount *ptr); extern inline int ExchangeInt(volatile int *ptr, int newval); extern inline void *ExchangePtr(XchgPtr *ptr, void *newval); extern inline int CompExchangeInt(volatile int *ptr, int oldval, int newval); diff --git a/common/rwlock.c b/common/rwlock.c index b967db0a..ff7aa418 100644 --- a/common/rwlock.c +++ b/common/rwlock.c @@ -24,8 +24,8 @@ static void Unlock(volatile int *l) void RWLockInit(RWLock *lock) { - lock->read_count = 0; - lock->write_count = 0; + InitRef(&lock->read_count, 0); + InitRef(&lock->write_count, 0); lock->read_lock = false; lock->read_entry_lock = false; lock->write_lock = false; |