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.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp
index 3e6032bdbd..ab045a808e 100644
--- a/Source/Core/Common/Src/Thread.cpp
+++ b/Source/Core/Common/Src/Thread.cpp
@@ -390,8 +390,12 @@ LONG SyncInterlockedExchange(LONG *Dest, LONG Val)
#if defined(__GNUC__) && defined (__GNUC_MINOR__) && ((4 < __GNUC__) || (4 == __GNUC__ && 1 <= __GNUC_MINOR__))
return __sync_lock_test_and_set(Dest, Val);
#else
- // TODO:
- #error Implement support older GCC Versions
+ register int result;
+ __asm__ __volatile__("lock; xchg %0,%1"
+ : "=r" (result), "=m" (*Dest)
+ : "0" (Val), "m" (*Dest)
+ : "memory");
+ return result;
#endif
}