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:
Sonicadvance1
2008-10-30 19:48:26 +00:00
parent a5ca940d64
commit 0ab16c6af0
4 changed files with 15 additions and 7 deletions

View File

@ -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