src/atomic/SDL_atomic.c
changeset 7860 2b0bcdea3a79
parent 7394 38dc4961ab15
child 8088 e5d77d5e0fe2
equal deleted inserted replaced
7859:af63b63e7aac 7860:2b0bcdea3a79
    53   Contributed by Bob Pendleton, bob@pendleton.com
    53   Contributed by Bob Pendleton, bob@pendleton.com
    54 */
    54 */
    55 
    55 
    56 static SDL_SpinLock locks[32];
    56 static SDL_SpinLock locks[32];
    57 
    57 
    58 static __inline__ void
    58 static SDL_INLINE void
    59 enterLock(void *a)
    59 enterLock(void *a)
    60 {
    60 {
    61     uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f);
    61     uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f);
    62 
    62 
    63     SDL_AtomicLock(&locks[index]);
    63     SDL_AtomicLock(&locks[index]);
    64 }
    64 }
    65 
    65 
    66 static __inline__ void
    66 static SDL_INLINE void
    67 leaveLock(void *a)
    67 leaveLock(void *a)
    68 {
    68 {
    69     uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f);
    69     uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f);
    70 
    70 
    71     SDL_AtomicUnlock(&locks[index]);
    71     SDL_AtomicUnlock(&locks[index]);