The Sequence Toolkit
www.sequence-toolkit.com |
Go to the source code of this file.
Macros | |
#define | stk_atomic_increment(_var) stk_fetch_and_add(_var,1) |
#define | stk_atomic_decrement(_var) stk_fetch_and_add(_var,-1) |
#define | stk_atomic_read(_var) stk_fetch_and_add(_var,0) |
Functions | |
stk_ret | stk_mutex_init (stk_mutex_t **mt_ptr) |
stk_ret | stk_mutex_destroy (stk_mutex_t *mutex) |
stk_ret | stk_mutex_lock (stk_mutex_t *mutex) |
stk_ret | stk_mutex_trylock (stk_mutex_t *mutex) |
stk_ret | stk_mutex_unlock (stk_mutex_t *mutex) |
int | stk_fetch_and_add (int *variable, int value) |
The stk_sync API's provide an atomic and mutex implementation used by STK modules
#define stk_atomic_decrement | ( | _var | ) | stk_fetch_and_add(_var,-1) |
Atomic decrement of an int.
#define stk_atomic_increment | ( | _var | ) | stk_fetch_and_add(_var,1) |
Atomic increment of an int.
#define stk_atomic_read | ( | _var | ) | stk_fetch_and_add(_var,0) |
Atomic read of an int.
int stk_fetch_and_add | ( | int * | variable, |
int | value | ||
) |
Atomic add of an int.
stk_ret stk_mutex_destroy | ( | stk_mutex_t * | mutex | ) |
Destroy a mutex
stk_ret stk_mutex_init | ( | stk_mutex_t ** | mt_ptr | ) |
Create a non-recursive mutex
stk_ret stk_mutex_lock | ( | stk_mutex_t * | mutex | ) |
Lock a mutex
stk_ret stk_mutex_trylock | ( | stk_mutex_t * | mutex | ) |
TryLock a mutex
stk_ret stk_mutex_unlock | ( | stk_mutex_t * | mutex | ) |
Unlock a mutex