zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_atomic.c File Reference
#include "SDL_config.h"
#include "SDL_atomic.h"

Go to the source code of this file.

Functions

static __inline__ void enterLock (void *a)
 
static __inline__ void leaveLock (void *a)
 
DECLSPEC SDL_bool SDLCALL 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...
 
DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr (void **a, void *oldval, void *newval)
 Set a pointer to a new value if it is currently an old value. More...
 

Variables

static SDL_SpinLock locks [32]
 

Function Documentation

static __inline__ void enterLock ( void a)
static

Definition at line 59 of file SDL_atomic.c.

References locks, and SDL_AtomicLock().

Referenced by SDL_AtomicCAS(), and SDL_AtomicCASPtr().

static __inline__ void leaveLock ( void a)
static

Definition at line 67 of file SDL_atomic.c.

References locks, and SDL_AtomicUnlock().

Referenced by SDL_AtomicCAS(), and SDL_AtomicCASPtr().

DECLSPEC SDL_bool SDLCALL 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.

Returns
SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
Note
If you don't know what this function is for, you shouldn't use it!

Definition at line 75 of file SDL_atomic.c.

References enterLock(), leaveLock(), SDL_FALSE, SDL_TRUE, and SDL_atomic_t::value.

Referenced by SDL_AtomicAdd(), and SDL_AtomicSet().

DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr ( void **  a,
void oldval,
void newval 
)

Set a pointer to a new value if it is currently an old value.

Returns
SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
Note
If you don't know what this function is for, you shouldn't use it!

Definition at line 90 of file SDL_atomic.c.

References enterLock(), leaveLock(), SDL_FALSE, and SDL_TRUE.

Referenced by SDL_AtomicSetPtr().

Variable Documentation

SDL_SpinLock locks[32]
static

Definition at line 56 of file SDL_atomic.c.

Referenced by enterLock(), and leaveLock().