Soletta™ Framework
Framework for making IoT devices

Full online documentation | C API Index
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs
Atomic

Macros

#define SOL_ATOMIC_ACQ_REL   memory_order_acq_rel
 Equivalent to C11 memory_order_acq_re (acquire and release). More...
 
#define SOL_ATOMIC_ACQUIRE   memory_order_acquire
 Equivalent to C11 memory_order_acquire. More...
 
#define sol_atomic_clear   atomic_flag_clear_explicit
 void sol_atomic_clear(atomic_flag *flag, int memory_order) More...
 
#define sol_atomic_compare_exchange   atomic_compare_exchange_strong_explicit
 bool sol_atomic_compare_exchange(atomic *object, value *expected, value desired, int memory_order_success, int memory_order_failure) More...
 
#define SOL_ATOMIC_CONSUME   memory_order_consume
 Equivalent to C11 memory_order_consume. More...
 
#define sol_atomic_exchange   atomic_exchange_explicit
 value sol_atomic_exchange(atomic *object, value new_value, int memory_order) More...
 
#define sol_atomic_fetch_add   atomic_fetch_add_explicit
 value sol_atomic_fetch_add(atomic *object, value addend, int memory_order) More...
 
#define SOL_ATOMIC_FLAG_INIT   ATOMIC_FLAG_INIT
 Used to initialize a sol_atommic_flag statically. More...
 
#define SOL_ATOMIC_INIT   ATOMIC_VAR_INIT
 Used to initialize one of the sol_atomic_ variables statically. More...
 
#define sol_atomic_load   atomic_load_explicit
 value sol_atomic_load(atomic *object, int memory_order) More...
 
#define SOL_ATOMIC_RELAXED   memory_order_relaxed
 Equivalent to C11 memory_order_relaxed. More...
 
#define SOL_ATOMIC_RELEASE   memory_order_release
 Equivalent to C11 memory_order_release. More...
 
#define SOL_ATOMIC_SEQ_CST   memory_order_seq_cst
 Equivalent to C11 memory_order_seq_cst (sequentially consistent). More...
 
#define sol_atomic_store   atomic_store_explicit
 void sol_atomic_store(atomic *object, type value, int memory_order) More...
 
#define sol_atomic_test_and_set   atomic_flag_test_and_set_explicit
 bool sol_atomic_test_and_set(atomic_flag *flag, int memory_order) More...
 

Typedefs

typedef atomic_flag sol_atomic_flag
 An atomic variable that can contain only two states: set or unset. More...
 
typedef atomic_int sol_atomic_int
 An atomic variable compatible with an int. More...
 
typedef atomic_size_t sol_atomic_size_t
 An atomic variable compatible with a size_t. More...
 
typedef atomic_uint sol_atomic_uint
 An atomic variable compatible with an unsigned int. More...
 
typedef atomic_uintptr_t sol_atomic_uintptr_t
 An atomic variable compatible with an uintptr_t. More...
 

Detailed Description

Macro Definition Documentation

#define SOL_ATOMIC_ACQ_REL   memory_order_acq_rel

Equivalent to C11 memory_order_acq_re (acquire and release).

#define SOL_ATOMIC_ACQUIRE   memory_order_acquire

Equivalent to C11 memory_order_acquire.

#define sol_atomic_clear   atomic_flag_clear_explicit

void sol_atomic_clear(atomic_flag *flag, int memory_order)

Clears the state in the flag flag using memory order memory_order.

#define sol_atomic_compare_exchange   atomic_compare_exchange_strong_explicit

bool sol_atomic_compare_exchange(atomic *object, value *expected, value desired, int memory_order_success, int memory_order_failure)

Executes an atomic compare-and-swap operation at object: if the value stored there is expected, then this function replaces it with desired, using memory order memory_order_success and returns true. If the value at object is not desired, then this function loads the current value into expected using memory order memory_order_failure and returns false.

This function is equivalent to C11's strong compare_exchange and its requirements on the memory ordering arguments apply here too.

#define SOL_ATOMIC_CONSUME   memory_order_consume

Equivalent to C11 memory_order_consume.

#define sol_atomic_exchange   atomic_exchange_explicit

value sol_atomic_exchange(atomic *object, value new_value, int memory_order)

Atomically replaces the value stored at object with new_value, using memory order memory_order, and returns the old value.

#define sol_atomic_fetch_add   atomic_fetch_add_explicit

value sol_atomic_fetch_add(atomic *object, value addend, int memory_order)

Atomically adds added to object and returns the new value, using memory order memory_order.

#define SOL_ATOMIC_FLAG_INIT   ATOMIC_FLAG_INIT

Used to initialize a sol_atommic_flag statically.

#define SOL_ATOMIC_INIT   ATOMIC_VAR_INIT

Used to initialize one of the sol_atomic_ variables statically.

#define sol_atomic_load   atomic_load_explicit

value sol_atomic_load(atomic *object, int memory_order)

Loads a value from object using memory order memory_order and returns it.

#define SOL_ATOMIC_RELAXED   memory_order_relaxed

Equivalent to C11 memory_order_relaxed.

#define SOL_ATOMIC_RELEASE   memory_order_release

Equivalent to C11 memory_order_release.

#define SOL_ATOMIC_SEQ_CST   memory_order_seq_cst

Equivalent to C11 memory_order_seq_cst (sequentially consistent).

#define sol_atomic_store   atomic_store_explicit

void sol_atomic_store(atomic *object, type value, int memory_order)

Stores value value at object, using the memory order memory_order.

#define sol_atomic_test_and_set   atomic_flag_test_and_set_explicit

bool sol_atomic_test_and_set(atomic_flag *flag, int memory_order)

Returns the previous value state of flag and marks it as set, using memory order memory_order.

Typedef Documentation

An atomic variable that can contain only two states: set or unset.

An atomic variable compatible with an int.

An atomic variable compatible with a size_t.

An atomic variable compatible with an unsigned int.

An atomic variable compatible with an uintptr_t.