Mercury
Typedefs | Functions
mercury_atomic.h File Reference
#include "mercury_util_config.h"
#include <opa_primitives.h>
Include dependency graph for mercury_atomic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef OPA_int_t hg_atomic_int32_t
 

Functions

static HG_UTIL_INLINE void hg_atomic_set32 (hg_atomic_int32_t *ptr, hg_util_int32_t value)
 Set atomic value (32-bit integer). More...
 
static HG_UTIL_INLINE
hg_util_int32_t 
hg_atomic_get32 (hg_atomic_int32_t *ptr)
 Get atomic value (32-bit integer). More...
 
static HG_UTIL_INLINE
hg_util_int32_t 
hg_atomic_incr32 (hg_atomic_int32_t *ptr)
 Increment atomic value (32-bit integer). More...
 
static HG_UTIL_INLINE
hg_util_int32_t 
hg_atomic_decr32 (hg_atomic_int32_t *ptr)
 Decrement atomic value (32-bit integer). More...
 
static HG_UTIL_INLINE
hg_util_bool_t 
hg_atomic_cas32 (hg_atomic_int32_t *ptr, hg_util_int32_t compare_value, hg_util_int32_t swap_value)
 Compare and swap values (32-bit integer). More...
 

Typedef Documentation

typedef OPA_int_t hg_atomic_int32_t

Definition at line 24 of file mercury_atomic.h.

Function Documentation

static HG_UTIL_INLINE void hg_atomic_set32 ( hg_atomic_int32_t ptr,
hg_util_int32_t  value 
)
static

Set atomic value (32-bit integer).

Parameters
ptr[OUT] pointer to an atomic32 integer
value[IN] value

Definition at line 38 of file mercury_atomic.h.

static HG_UTIL_INLINE hg_util_int32_t hg_atomic_get32 ( hg_atomic_int32_t ptr)
static

Get atomic value (32-bit integer).

Parameters
ptr[OUT] pointer to an atomic32 integer
Returns
Value of the atomic integer

Definition at line 55 of file mercury_atomic.h.

static HG_UTIL_INLINE hg_util_int32_t hg_atomic_incr32 ( hg_atomic_int32_t ptr)
static

Increment atomic value (32-bit integer).

Parameters
ptr[IN/OUT] pointer to an atomic32 integer
Returns
Incremented value

Definition at line 76 of file mercury_atomic.h.

static HG_UTIL_INLINE hg_util_int32_t hg_atomic_decr32 ( hg_atomic_int32_t ptr)
static

Decrement atomic value (32-bit integer).

Parameters
ptr[IN/OUT] pointer to an atomic32 integer
Returns
Decremented value

Definition at line 99 of file mercury_atomic.h.

static HG_UTIL_INLINE hg_util_bool_t hg_atomic_cas32 ( hg_atomic_int32_t ptr,
hg_util_int32_t  compare_value,
hg_util_int32_t  swap_value 
)
static

Compare and swap values (32-bit integer).

Parameters
ptr[IN/OUT] pointer to an atomic32 integer
compare_value[IN] value to compare to
swap_value[IN] value to swap with if ptr value is equal to compare value
Returns
HG_UTIL_TRUE if swapped or HG_UTIL_FALSE

Definition at line 125 of file mercury_atomic.h.