SDL
2.0
|
Go to the source code of this file.
Macros | |
#define | PAUSE_INSTRUCTION() |
Functions | |
SDL_bool | SDL_AtomicTryLock (SDL_SpinLock *lock) |
Try to lock a spin lock by setting it to a non-zero value. More... | |
void | SDL_AtomicLock (SDL_SpinLock *lock) |
Lock a spin lock by setting it to a non-zero value. More... | |
void | SDL_AtomicUnlock (SDL_SpinLock *lock) |
Unlock a spin lock by setting it to 0. Always returns immediately. More... | |
#define PAUSE_INSTRUCTION | ( | ) |
Definition at line 133 of file SDL_spinlock.c.
Referenced by SDL_AtomicLock(), and SDL_AtomicTryLock().
void SDL_AtomicLock | ( | SDL_SpinLock * | lock | ) |
Lock a spin lock by setting it to a non-zero value.
lock | Points to the lock. |
Definition at line 137 of file SDL_spinlock.c.
References iterations, PAUSE_INSTRUCTION, SDL_AtomicTryLock(), and SDL_Delay.
SDL_bool SDL_AtomicTryLock | ( | SDL_SpinLock * | lock | ) |
Try to lock a spin lock by setting it to a non-zero value.
lock | Points to the lock. |
Definition at line 51 of file SDL_spinlock.c.
References lock, PAUSE_INSTRUCTION, SDL_COMPILE_TIME_ASSERT, SDL_CreateMutex, SDL_FALSE, SDL_LockMutex, SDL_TRUE, and SDL_UnlockMutex.
Referenced by SDL_AtomicLock().
void SDL_AtomicUnlock | ( | SDL_SpinLock * | lock | ) |
Unlock a spin lock by setting it to 0. Always returns immediately.
lock | Points to the lock. |
Definition at line 153 of file SDL_spinlock.c.
References SDL_CompilerBarrier.