mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Added InterlockedExchange to Linux side
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1018 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -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
|
||||
|
||||
|
@ -116,6 +116,7 @@ void SetCurrentThreadName(const char *name);
|
||||
|
||||
#ifndef _WIN32
|
||||
int InterlockedExchangeAdd(int *Addend, int Increment);
|
||||
int InterlockedExchange(int *Addend, int Increment);
|
||||
#endif
|
||||
|
||||
} // end of namespace Common
|
||||
|
Reference in New Issue
Block a user