The Sequence Toolkit
www.sequence-toolkit.com
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Typedefs
stk_sync.h File Reference
#include <pthread.h>
#include <opa_primitives.h>
Include dependency graph for stk_sync.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STK_ATOMIC_INCR(_ptr)   OPA_fetch_and_incr_int((OPA_int_t*)_ptr)
 
#define STK_ATOMIC_DECR(_ptr)   OPA_fetch_and_decr_int((OPA_int_t*)_ptr)
 
#define STK_ATOMIC_ADD(_ptr, _val)   OPA_fetch_and_add_int((OPA_int_t*)_ptr,_val)
 

Typedefs

typedef pthread_mutex_t stk_mutex_t
 

Detailed Description

This header provides the macros and type definitions for atomic and mutex implementations used throughout STK.

Macro Definition Documentation

#define STK_ATOMIC_ADD (   _ptr,
  _val 
)    OPA_fetch_and_add_int((OPA_int_t*)_ptr,_val)

Atomic add of a number to an integer

#define STK_ATOMIC_DECR (   _ptr)    OPA_fetch_and_decr_int((OPA_int_t*)_ptr)

Atomic Decrement an integer

#define STK_ATOMIC_INCR (   _ptr)    OPA_fetch_and_incr_int((OPA_int_t*)_ptr)

Atomic Increment an integer

Typedef Documentation

typedef pthread_mutex_t stk_mutex_t

Definition of a mutex