The Sequence Toolkit
www.sequence-toolkit.com
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
include
stk_sync_api.h
Go to the documentation of this file.
1
4
#ifndef STK_SYNC_API_H
5
#define STK_SYNC_API_H
6
#include "
stk_sync.h
"
7
#include "
stk_common.h
"
8
#include <pthread.h>
9
14
stk_ret
stk_mutex_init
(
stk_mutex_t
**mt_ptr);
19
stk_ret
stk_mutex_destroy
(
stk_mutex_t
*mutex);
24
stk_ret
stk_mutex_lock
(
stk_mutex_t
*mutex);
29
stk_ret
stk_mutex_trylock
(
stk_mutex_t
*mutex);
34
stk_ret
stk_mutex_unlock
(
stk_mutex_t
*mutex);
35
40
int
stk_fetch_and_add
(
int
* variable,
int
value );
45
#define stk_atomic_increment(_var) stk_fetch_and_add(_var,1)
46
50
#define stk_atomic_decrement(_var) stk_fetch_and_add(_var,-1)
51
55
#define stk_atomic_read(_var) stk_fetch_and_add(_var,0)
56
57
#endif
Sequence Toolkit
API, Wed Apr 15 2015 22:32:53