summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-22 18:18:14 -0700
committerChris Robinson <[email protected]>2014-07-22 18:18:14 -0700
commita3b1d4a5e20fade26bdfe2b964d8d363aac2acc3 (patch)
treec47dd10f78cc6fee6f595f1108e7a666d8fb3614 /common
parent5a339a2a5b12545c105a2a3dcfb1d8e466b0381f (diff)
Implement RefCount as a generic atomic type
Diffstat (limited to 'common')
-rw-r--r--common/atomic.c13
1 files changed, 7 insertions, 6 deletions
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);