Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
roc::core::AtomicOps Class Reference

Atomic operations. This wrapper exists because on non-C11 compilers we use another implementation. More...

#include <atomic_ops.h>

Static Public Member Functions

Memory fence
static void fence_acquire ()
 Acquire memory barrier. More...
 
static void fence_release ()
 Release memory barrier. More...
 
static void fence_seq_cst ()
 Full memory barrier. More...
 
Load
template<class T >
static T load_relaxed (const T &var)
 Atomic load (no barrier). More...
 
template<class T >
static T load_acquire (const T &var)
 Atomic load (acquire barrier). More...
 
template<class T >
static T load_seq_cst (const T &var)
 Atomic load (full barrier). More...
 
Store
template<class T1 , class T2 >
static void store_relaxed (T1 &var, T2 val)
 Atomic store (no barrier). More...
 
template<class T1 , class T2 >
static void store_release (T1 &var, T2 val)
 Atomic store (release barrier). More...
 
template<class T1 , class T2 >
static void store_seq_cst (T1 &var, T2 val)
 Atomic store (full barrier). More...
 
Exchange
template<class T1 , class T2 >
static T1 exchange_relaxed (T1 &var, T2 val)
 Atomic exchange (no barrier). More...
 
template<class T1 , class T2 >
static T1 exchange_acquire (T1 &var, T2 val)
 Atomic exchange (acquire barrier). More...
 
template<class T1 , class T2 >
static T1 exchange_release (T1 &var, T2 val)
 Atomic exchange (release barrier). More...
 
template<class T1 , class T2 >
static T1 exchange_acq_rel (T1 &var, T2 val)
 Atomic exchange (acquire-release barrier). More...
 
template<class T1 , class T2 >
static T1 exchange_seq_cst (T1 &var, T2 val)
 Atomic exchange (full barrier). More...
 
CAS
template<class T1 , class T2 >
static bool compare_exchange_relaxed (T1 &var, T1 &exp, T2 des)
 Atomic compare-and-swap (no barrier). More...
 
template<class T1 , class T2 >
static bool compare_exchange_acquire (T1 &var, T1 &exp, T2 des)
 Atomic compare-and-swap (acquire barrier). More...
 
template<class T1 , class T2 >
static bool compare_exchange_release (T1 &var, T1 &exp, T2 des)
 Atomic compare-and-swap (release barrier). More...
 
template<class T1 , class T2 >
static bool compare_exchange_acq_rel (T1 &var, T1 &exp, T2 des)
 Atomic compare-and-swap (acquire-release barrier). More...
 
template<class T1 , class T2 >
static bool compare_exchange_seq_cst (T1 &var, T1 &exp, T2 des)
 Atomic compare-and-swap (full barrier). More...
 
Addition
template<class T1 , class T2 >
static T1 fetch_add_relaxed (T1 &var, T2 val)
 Atomic fetch-add (no barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_add_acquire (T1 &var, T2 val)
 Atomic add-and-fetch (acquire barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_add_release (T1 &var, T2 val)
 Atomic add-and-fetch (release barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_add_seq_cst (T1 &var, T2 val)
 Atomic add-and-fetch (full barrier). More...
 
Subtraction
template<class T1 , class T2 >
static T1 fetch_sub_relaxed (T1 &var, T2 val)
 Atomic fetch-sub (no barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_sub_acquire (T1 &var, T2 val)
 Atomic sub-and-fetch (acquire barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_sub_release (T1 &var, T2 val)
 Atomic sub-and-fetch (release barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_sub_seq_cst (T1 &var, T2 val)
 Atomic sub-and-fetch (full barrier). More...
 
Bitwise AND
template<class T1 , class T2 >
static T1 fetch_and_relaxed (T1 &var, T2 val)
 Atomic fetch-and (no barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_and_acquire (T1 &var, T2 val)
 Atomic fetch-and (acquire barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_and_release (T1 &var, T2 val)
 Atomic fetch-and (release barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_and_seq_cst (T1 &var, T2 val)
 Atomic fetch-and (full barrier). More...
 
Bitwise OR
template<class T1 , class T2 >
static T1 fetch_or_relaxed (T1 &var, T2 val)
 Atomic fetch-or (no barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_or_acquire (T1 &var, T2 val)
 Atomic fetch-or (acquire barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_or_release (T1 &var, T2 val)
 Atomic fetch-or (release barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_or_seq_cst (T1 &var, T2 val)
 Atomic fetch-or (full barrier). More...
 
Bitwise XOR
template<class T1 , class T2 >
static T1 fetch_xor_relaxed (T1 &var, T2 val)
 Atomic fetch-xor (no barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_xor_acquire (T1 &var, T2 val)
 Atomic fetch-xor (acquire barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_xor_release (T1 &var, T2 val)
 Atomic fetch-xor (release barrier). More...
 
template<class T1 , class T2 >
static T1 fetch_xor_seq_cst (T1 &var, T2 val)
 Atomic fetch-xor (full barrier). More...
 

Detailed Description

Atomic operations. This wrapper exists because on non-C11 compilers we use another implementation.

Atomic operations.

Definition at line 20 of file atomic_ops.h.

Member Function Documentation

◆ compare_exchange_acq_rel()

template<class T1 , class T2 >
static bool roc::core::AtomicOps::compare_exchange_acq_rel ( T1 &  var,
T1 &  exp,
T2  des 
)
inlinestatic

Atomic compare-and-swap (acquire-release barrier).

Definition at line 138 of file atomic_ops.h.

◆ compare_exchange_acquire()

template<class T1 , class T2 >
static bool roc::core::AtomicOps::compare_exchange_acquire ( T1 &  var,
T1 &  exp,
T2  des 
)
inlinestatic

Atomic compare-and-swap (acquire barrier).

Definition at line 124 of file atomic_ops.h.

◆ compare_exchange_relaxed()

template<class T1 , class T2 >
static bool roc::core::AtomicOps::compare_exchange_relaxed ( T1 &  var,
T1 &  exp,
T2  des 
)
inlinestatic

Atomic compare-and-swap (no barrier).

Definition at line 117 of file atomic_ops.h.

◆ compare_exchange_release()

template<class T1 , class T2 >
static bool roc::core::AtomicOps::compare_exchange_release ( T1 &  var,
T1 &  exp,
T2  des 
)
inlinestatic

Atomic compare-and-swap (release barrier).

Definition at line 131 of file atomic_ops.h.

◆ compare_exchange_seq_cst()

template<class T1 , class T2 >
static bool roc::core::AtomicOps::compare_exchange_seq_cst ( T1 &  var,
T1 &  exp,
T2  des 
)
inlinestatic

Atomic compare-and-swap (full barrier).

Definition at line 145 of file atomic_ops.h.

◆ exchange_acq_rel()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::exchange_acq_rel ( T1 &  var,
T2  val 
)
inlinestatic

Atomic exchange (acquire-release barrier).

Definition at line 101 of file atomic_ops.h.

◆ exchange_acquire()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::exchange_acquire ( T1 &  var,
T2  val 
)
inlinestatic

Atomic exchange (acquire barrier).

Definition at line 91 of file atomic_ops.h.

◆ exchange_relaxed()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::exchange_relaxed ( T1 &  var,
T2  val 
)
inlinestatic

Atomic exchange (no barrier).

Definition at line 86 of file atomic_ops.h.

◆ exchange_release()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::exchange_release ( T1 &  var,
T2  val 
)
inlinestatic

Atomic exchange (release barrier).

Definition at line 96 of file atomic_ops.h.

◆ exchange_seq_cst()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::exchange_seq_cst ( T1 &  var,
T2  val 
)
inlinestatic

Atomic exchange (full barrier).

Definition at line 106 of file atomic_ops.h.

◆ fence_acquire()

static void roc::core::AtomicOps::fence_acquire ( )
inlinestatic

Acquire memory barrier.

Definition at line 26 of file atomic_ops.h.

◆ fence_release()

static void roc::core::AtomicOps::fence_release ( )
inlinestatic

Release memory barrier.

Definition at line 31 of file atomic_ops.h.

◆ fence_seq_cst()

static void roc::core::AtomicOps::fence_seq_cst ( )
inlinestatic

Full memory barrier.

Definition at line 36 of file atomic_ops.h.

◆ fetch_add_acquire()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_add_acquire ( T1 &  var,
T2  val 
)
inlinestatic

Atomic add-and-fetch (acquire barrier).

Definition at line 161 of file atomic_ops.h.

◆ fetch_add_relaxed()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_add_relaxed ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-add (no barrier).

Definition at line 156 of file atomic_ops.h.

◆ fetch_add_release()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_add_release ( T1 &  var,
T2  val 
)
inlinestatic

Atomic add-and-fetch (release barrier).

Definition at line 166 of file atomic_ops.h.

◆ fetch_add_seq_cst()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_add_seq_cst ( T1 &  var,
T2  val 
)
inlinestatic

Atomic add-and-fetch (full barrier).

Definition at line 171 of file atomic_ops.h.

◆ fetch_and_acquire()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_and_acquire ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-and (acquire barrier).

Definition at line 211 of file atomic_ops.h.

◆ fetch_and_relaxed()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_and_relaxed ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-and (no barrier).

Definition at line 206 of file atomic_ops.h.

◆ fetch_and_release()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_and_release ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-and (release barrier).

Definition at line 216 of file atomic_ops.h.

◆ fetch_and_seq_cst()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_and_seq_cst ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-and (full barrier).

Definition at line 221 of file atomic_ops.h.

◆ fetch_or_acquire()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_or_acquire ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-or (acquire barrier).

Definition at line 236 of file atomic_ops.h.

◆ fetch_or_relaxed()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_or_relaxed ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-or (no barrier).

Definition at line 231 of file atomic_ops.h.

◆ fetch_or_release()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_or_release ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-or (release barrier).

Definition at line 241 of file atomic_ops.h.

◆ fetch_or_seq_cst()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_or_seq_cst ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-or (full barrier).

Definition at line 246 of file atomic_ops.h.

◆ fetch_sub_acquire()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_sub_acquire ( T1 &  var,
T2  val 
)
inlinestatic

Atomic sub-and-fetch (acquire barrier).

Definition at line 186 of file atomic_ops.h.

◆ fetch_sub_relaxed()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_sub_relaxed ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-sub (no barrier).

Definition at line 181 of file atomic_ops.h.

◆ fetch_sub_release()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_sub_release ( T1 &  var,
T2  val 
)
inlinestatic

Atomic sub-and-fetch (release barrier).

Definition at line 191 of file atomic_ops.h.

◆ fetch_sub_seq_cst()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_sub_seq_cst ( T1 &  var,
T2  val 
)
inlinestatic

Atomic sub-and-fetch (full barrier).

Definition at line 196 of file atomic_ops.h.

◆ fetch_xor_acquire()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_xor_acquire ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-xor (acquire barrier).

Definition at line 261 of file atomic_ops.h.

◆ fetch_xor_relaxed()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_xor_relaxed ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-xor (no barrier).

Definition at line 256 of file atomic_ops.h.

◆ fetch_xor_release()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_xor_release ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-xor (release barrier).

Definition at line 266 of file atomic_ops.h.

◆ fetch_xor_seq_cst()

template<class T1 , class T2 >
static T1 roc::core::AtomicOps::fetch_xor_seq_cst ( T1 &  var,
T2  val 
)
inlinestatic

Atomic fetch-xor (full barrier).

Definition at line 271 of file atomic_ops.h.

◆ load_acquire()

template<class T >
static T roc::core::AtomicOps::load_acquire ( const T &  var)
inlinestatic

Atomic load (acquire barrier).

Definition at line 51 of file atomic_ops.h.

◆ load_relaxed()

template<class T >
static T roc::core::AtomicOps::load_relaxed ( const T &  var)
inlinestatic

Atomic load (no barrier).

Definition at line 46 of file atomic_ops.h.

◆ load_seq_cst()

template<class T >
static T roc::core::AtomicOps::load_seq_cst ( const T &  var)
inlinestatic

Atomic load (full barrier).

Definition at line 56 of file atomic_ops.h.

◆ store_relaxed()

template<class T1 , class T2 >
static void roc::core::AtomicOps::store_relaxed ( T1 &  var,
T2  val 
)
inlinestatic

Atomic store (no barrier).

Definition at line 66 of file atomic_ops.h.

◆ store_release()

template<class T1 , class T2 >
static void roc::core::AtomicOps::store_release ( T1 &  var,
T2  val 
)
inlinestatic

Atomic store (release barrier).

Definition at line 71 of file atomic_ops.h.

◆ store_seq_cst()

template<class T1 , class T2 >
static void roc::core::AtomicOps::store_seq_cst ( T1 &  var,
T2  val 
)
inlinestatic

Atomic store (full barrier).

Definition at line 76 of file atomic_ops.h.


The documentation for this class was generated from the following file: