src/atomic/SDL_spinlock.c
changeset 5998 e9b9ef14aef4
parent 5957 9a2b091abb2c
child 5999 0e3fd8178e1d
equal deleted inserted replaced
5997:69875bbf83d8 5998:e9b9ef14aef4
    79 	__asm__ __volatile__(
    79 	__asm__ __volatile__(
    80         "lock ; xchgl %0, (%1)\n"
    80         "lock ; xchgl %0, (%1)\n"
    81         : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory");
    81         : "=r" (result) : "r" (lock), "0" (1) : "cc", "memory");
    82 	return (result == 0);
    82 	return (result == 0);
    83 
    83 
    84 #elif defined(__MACOSX__)
    84 #elif defined(__MACOSX__) || defined(__IPHONEOS__)
    85     /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */
    85     /* Maybe used for PowerPC, but the Intel asm or gcc atomics are favored. */
    86     return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
    86     return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
    87 
    87 
    88 #elif HAVE_PTHREAD_SPINLOCK
    88 #elif HAVE_PTHREAD_SPINLOCK
    89     /* pthread instructions */
    89     /* pthread instructions */