From a3b1d4a5e20fade26bdfe2b964d8d363aac2acc3 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 22 Jul 2014 18:18:14 -0700 Subject: Implement RefCount as a generic atomic type --- common/atomic.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'common') diff --git a/common/atomic.c b/common/atomic.c index 634587e4..ab258e8e 100644 --- a/common/atomic.c +++ b/common/atomic.c @@ -4,12 +4,13 @@ #include "atomic.h" -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 uint ExchangeRef(volatile RefCount *ptr, uint newval); -extern inline uint CompExchangeRef(volatile RefCount *ptr, uint oldval, uint newval); +extern inline void InitRef(RefCount *ptr, uint value); +extern inline uint ReadRef(RefCount *ptr); +extern inline uint IncrementRef(RefCount *ptr); +extern inline uint DecrementRef(RefCount *ptr); +extern inline uint ExchangeRef(RefCount *ptr, uint newval); +extern inline uint CompExchangeRef(RefCount *ptr, uint oldval, uint newval); + 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); -- cgit v1.2.3