|
SDL
2.0
|
Include dependency graph for SDL_atomic.c:Go to the source code of this file.
Macros | |
| #define | EMULATE_CAS 1 |
Functions | |
| static SDL_INLINE void | enterLock (void *a) |
| static SDL_INLINE void | leaveLock (void *a) |
| SDL_bool | SDL_AtomicCAS (SDL_atomic_t *a, int oldval, int newval) |
| Set an atomic variable to a new value if it is currently an old value. More... | |
| SDL_bool | SDL_AtomicCASPtr (void **a, void *oldval, void *newval) |
| Set a pointer to a new value if it is currently an old value. More... | |
| int | SDL_AtomicSet (SDL_atomic_t *a, int v) |
| Set an atomic variable to a value. More... | |
| void * | SDL_AtomicSetPtr (void **a, void *v) |
| Set a pointer to a value atomically. More... | |
| int | SDL_AtomicAdd (SDL_atomic_t *a, int v) |
| Add to an atomic variable. More... | |
| int | SDL_AtomicGet (SDL_atomic_t *a) |
| Get the value of an atomic variable. More... | |
| void * | SDL_AtomicGetPtr (void **a) |
| Get the value of a pointer atomically. More... | |
Variables | |
| static SDL_SpinLock | locks [32] |
| #define EMULATE_CAS 1 |
Definition at line 62 of file SDL_atomic.c.
|
static |
Definition at line 69 of file SDL_atomic.c.
References locks, SDL_AtomicLock, and SDL_INLINE.
Referenced by SDL_AtomicCAS(), and SDL_AtomicCASPtr().
|
static |
Definition at line 77 of file SDL_atomic.c.
References locks, and SDL_AtomicUnlock.
Referenced by SDL_AtomicCAS(), and SDL_AtomicCASPtr().
| int SDL_AtomicAdd | ( | SDL_atomic_t * | a, |
| int | v | ||
| ) |
Add to an atomic variable.
Definition at line 187 of file SDL_atomic.c.
References SDL_AtomicCAS(), and SDL_atomic_t::value.
| SDL_bool SDL_AtomicCAS | ( | SDL_atomic_t * | a, |
| int | oldval, | ||
| int | newval | ||
| ) |
Set an atomic variable to a new value if it is currently an old value.
Definition at line 87 of file SDL_atomic.c.
References enterLock(), leaveLock(), retval, SDL_FALSE, SDL_TRUE, and SDL_atomic_t::value.
Referenced by SDL_AtomicAdd(), SDL_AtomicGet(), and SDL_AtomicSet().
Set a pointer to a new value if it is currently an old value.
Definition at line 116 of file SDL_atomic.c.
References enterLock(), leaveLock(), retval, SDL_FALSE, and SDL_TRUE.
Referenced by SDL_AtomicGetPtr(), and SDL_AtomicSetPtr().
| int SDL_AtomicGet | ( | SDL_atomic_t * | a | ) |
Get the value of an atomic variable.
Definition at line 212 of file SDL_atomic.c.
References SDL_AtomicCAS(), and SDL_atomic_t::value.
Get the value of a pointer atomically.
Definition at line 222 of file SDL_atomic.c.
References SDL_AtomicCASPtr().
| int SDL_AtomicSet | ( | SDL_atomic_t * | a, |
| int | v | ||
| ) |
Set an atomic variable to a value.
Definition at line 147 of file SDL_atomic.c.
References SDL_AtomicCAS(), and SDL_atomic_t::value.
Set a pointer to a value atomically.
Definition at line 167 of file SDL_atomic.c.
References SDL_AtomicCASPtr().
|
static |
Definition at line 66 of file SDL_atomic.c.
Referenced by enterLock(), and leaveLock().