summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Src/Thread.cpp')
-rw-r--r--Source/Core/Common/Src/Thread.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp
index 95b5d1ca65..ce95776242 100644
--- a/Source/Core/Common/Src/Thread.cpp
+++ b/Source/Core/Common/Src/Thread.cpp
@@ -358,6 +358,15 @@ int InterlockedExchangeAdd(int *Addend, int Increment)
return result + Increment;
#endif
}
+int InterlockedExchange(int *Addend, int Increment)
+{
+#if defined(__GNUC__) && defined (__GNUC_MINOR__) && ((4 < __GNUC__) || (4 == __GNUC__ && 1 <= __GNUC_MINOR__))
+ return __sync_lock_test_and_set(Addend, Increment);
+#else
+ // TODO:
+ #warning Support older GCC Versions
+#endif
+}
#endif