summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/Thread.cpp
diff options
context:
space:
mode:
authorNolan Check <Nolan.Check@gmail.com>2009-07-13 05:38:34 +0000
committerNolan Check <Nolan.Check@gmail.com>2009-07-13 05:38:34 +0000
commitd779554ff37cafe9ecc854b33ace81e94094dead (patch)
treebf7870f0c373f6b284be5395ad750765bd0e0bad /Source/Core/Common/Src/Thread.cpp
parent3070e159c6919d632b37f7ead35792af546f7bc0 (diff)
Atomic operations library.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3775 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/Thread.cpp')
-rw-r--r--Source/Core/Common/Src/Thread.cpp61
1 files changed, 0 insertions, 61 deletions
diff --git a/Source/Core/Common/Src/Thread.cpp b/Source/Core/Common/Src/Thread.cpp
index 61029aa2d6..53ea908b77 100644
--- a/Source/Core/Common/Src/Thread.cpp
+++ b/Source/Core/Common/Src/Thread.cpp
@@ -31,10 +31,6 @@
namespace Common
{
-#ifndef _WIN32
-// TODO see thread.h
-void MemFence(){;}
-#endif
#ifdef _WIN32
@@ -325,21 +321,6 @@ void SetCurrentThreadName(const TCHAR* szThreadName)
__except(EXCEPTION_CONTINUE_EXECUTION)
{}
}
-// TODO: check if ever inline
-LONG SyncInterlockedIncrement(LONG *Dest)
-{
- return InterlockedIncrement(Dest);
-}
-
-LONG SyncInterlockedExchangeAdd(LONG *Dest, LONG Val)
-{
- return InterlockedExchangeAdd(Dest, Val);
-}
-
-LONG SyncInterlockedExchange(LONG *Dest, LONG Val)
-{
- return InterlockedExchange(Dest, Val);
-}
#else // !WIN32, so must be POSIX threads
@@ -516,48 +497,6 @@ void Event::Wait()
pthread_mutex_unlock(&mutex_);
}
-LONG SyncInterlockedIncrement(LONG *Dest)
-{
-#if defined(__GNUC__) && defined (__GNUC_MINOR__) && ((4 < __GNUC__) || (4 == __GNUC__ && 1 <= __GNUC_MINOR__))
- return __sync_add_and_fetch(Dest, 1);
-#else
- register int result;
- __asm__ __volatile__("lock; xadd %0,%1"
- : "=r" (result), "=m" (*Dest)
- : "0" (1), "m" (*Dest)
- : "memory");
- return result;
-#endif
-}
-
-LONG SyncInterlockedExchangeAdd(LONG *Dest, LONG Val)
-{
-#if defined(__GNUC__) && defined (__GNUC_MINOR__) && ((4 < __GNUC__) || (4 == __GNUC__ && 1 <= __GNUC_MINOR__))
- return __sync_add_and_fetch(Dest, Val);
-#else
- register int result;
- __asm__ __volatile__("lock; xadd %0,%1"
- : "=r" (result), "=m" (*Dest)
- : "0" (Val), "m" (*Dest)
- : "memory");
- return result;
-#endif
-}
-
-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
- register int result;
- __asm__ __volatile__("lock; xchg %0,%1"
- : "=r" (result), "=m" (*Dest)
- : "0" (Val), "m" (*Dest)
- : "memory");
- return result;
-#endif
-}
-
#endif
} // namespace Common