From d779554ff37cafe9ecc854b33ace81e94094dead Mon Sep 17 00:00:00 2001 From: Nolan Check Date: Mon, 13 Jul 2009 05:38:34 +0000 Subject: Atomic operations library. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3775 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/Thread.cpp | 61 --------------------------------------- 1 file changed, 61 deletions(-) (limited to 'Source/Core/Common/Src/Thread.cpp') 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 -- cgit v1.2.3