summaryrefslogtreecommitdiff
path: root/core/safe_refcount.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/safe_refcount.cpp')
-rw-r--r--core/safe_refcount.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp
index f0d4fbd610..ede37bbe8a 100644
--- a/core/safe_refcount.cpp
+++ b/core/safe_refcount.cpp
@@ -76,6 +76,9 @@ uint32_t atomic_decrement( register uint32_t * pw ) {
return InterlockedDecrement( (LONG volatile*)pw );
}
+uint32_t atomic_increment( register uint32_t * pw ) {
+ return InterlockedIncrement( (LONG volatile*)pw );
+}
#elif defined(__GNUC__)
uint32_t atomic_conditional_increment( register uint32_t * pw ) {
@@ -95,6 +98,12 @@ uint32_t atomic_decrement( register uint32_t * pw ) {
}
+uint32_t atomic_increment( register uint32_t * pw ) {
+
+ return __sync_add_and_fetch(pw,1);
+
+}
+
#else
//no threads supported?
#error Must provide atomic functions for this platform or compiler!