Mercurial > sdl-ios-xcode
comparison src/atomic/SDL_spinlock.c @ 5071:55ff76cdbbb8
HAVE_GCC_ATOMICS covers the test and set
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Fri, 21 Jan 2011 21:45:55 -0800 |
parents | fd125217f00c |
children | 1e94e68525d5 |
comparison
equal
deleted
inserted
replaced
5070:042ad5e274ed | 5071:55ff76cdbbb8 |
---|---|
34 return (_InterlockedExchange((long*)lock, 1) == 0); | 34 return (_InterlockedExchange((long*)lock, 1) == 0); |
35 | 35 |
36 #elif defined(__MACOSX__) | 36 #elif defined(__MACOSX__) |
37 return OSAtomicCompareAndSwap32Barrier(0, 1, lock); | 37 return OSAtomicCompareAndSwap32Barrier(0, 1, lock); |
38 | 38 |
39 #elif defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) | 39 #elif defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET) |
40 return (__sync_lock_test_and_set(lock, 1) == 0); | 40 return (__sync_lock_test_and_set(lock, 1) == 0); |
41 | 41 |
42 #elif defined(__GNUC__) && defined(__arm__) && defined(__ARM_ARCH_5__) | 42 #elif defined(__GNUC__) && defined(__arm__) && defined(__ARM_ARCH_5__) |
43 int result; | 43 int result; |
44 __asm__ __volatile__ ( | 44 __asm__ __volatile__ ( |