Atomicity
Jule provides C-style macro functions for atomicity in atomic.hpp
header. While you can't normally use the stdatomic.h
header with C++, the definitions are pretty similar to the stdatomic.h
implementation.
Macro Defines for Memory Ordering
#define __JULE_ATOMIC_MEMORY_ORDER__RELAXED
#define __JULE_ATOMIC_MEMORY_ORDER__RELEASE
#define __JULE_ATOMIC_MEMORY_ORDER__CONSUME
#define __JULE_ATOMIC_MEMORY_ORDER__ACQUIRE
#define __JULE_ATOMIC_MEMORY_ORDER__ACQ_REL
#define __JULE_ATOMIC_MEMORY_ORDER__SEQ_CST
Macro Functions
#define __jule_atomic_store_explicit(ADDR, VAL, MO)
Atomically stores val into addr by memory ordering.
#define __jule_atomic_store(ADDR, VAL)
Calls __jule_atomic_store_explicit
with SeqCst memory ordering.
#define __jule_atomic_load_explicit(ADDR, MO)
Atomically loads value of addr by memory ordering.
#define __jule_atomic_load(ADDR)
Calls __jule_atomic_load_explicit
with SeqCst memory ordering.
#define __jule_atomic_swap_explicit(ADDR, NEW, MO)
Atomically stores new into addr and returns the previous addr value by memory ordering.
#define __jule_atomic_swap(ADDR, NEW)
Calls __jule_atomic_swap
with SeqCst memory ordering.
#define __jule_atomic_compare_swap_explicit(ADDR, OLD, NEW, SUC, FAIL)
Executes the compare-and-swap operation for addr by memory ordering.
#define __jule_atomic_compare_swap(ADDR, OLD, NEW)
Calls __jule_atomic_compare_swap_explicit
with SeqCst memory ordering.
#define __jule_atomic_add_explicit(ADDR, DELTA, MO)
Atomically adds delta to addr and returns the previous addr value by memory ordering.
#define __jule_atomic_add(ADDR, DELTA)
Calls __jule_atomic_add
with SeqCst memory ordering.