Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)
« « « Anklang Documentation |
#include "atomics.hh"
Public Member Functions | |
bool | empty () const |
Check if poppingreturns null. | |
bool | push_chain (T *first, T *last) |
Atomically push linked nodes first->…->last onto the stack, returns was_empty . | |
bool | push (T *el) |
Atomically push el onto the stack, returns was_empty . | |
T * | pop_all () |
T * | pop_reversed () |
Lock-free stack with atomic push()
and pop_all
operations. Relies on unqualified calls to atomic<T*>& atomic_next_ptrref(T*)
.
Definition at line 21 of file atomics.hh.
Ase::AtomicIntrusiveStack< T >::AtomicIntrusiveStack | ( | ) |
Definition at line 25 of file atomics.hh.
bool Ase::AtomicIntrusiveStack< T >::empty | ( | ) | const |
Check if poppingreturns null.
Definition at line 32 of file atomics.hh.
References std::atomic::load().
T * Ase::AtomicIntrusiveStack< T >::pop_all | ( | ) |
Atomically pop all elements from the stack in LIFO order. Use atomic_next_ptrref()
for iteration.
Definition at line 58 of file atomics.hh.
References std::atomic::compare_exchange_strong(), and std::atomic::load().
Referenced by Ase::AtomicIntrusiveStack< T >::pop_reversed().
T * Ase::AtomicIntrusiveStack< T >::pop_reversed | ( | ) |
Atomically pop all elements from the stack in FIFO order. Use atomic_next_ptrref()
for iteration.
Definition at line 69 of file atomics.hh.
References Ase::AtomicIntrusiveStack< T >::pop_all().
bool Ase::AtomicIntrusiveStack< T >::push | ( | T * | el | ) |
Atomically push el
onto the stack, returns was_empty
.
Definition at line 51 of file atomics.hh.
References Ase::AtomicIntrusiveStack< T >::push_chain().
bool Ase::AtomicIntrusiveStack< T >::push_chain | ( | T * | first, |
T * | last | ||
) |
Atomically push linked nodes first->…->last
onto the stack, returns was_empty
.
Definition at line 38 of file atomics.hh.
References ASE_ASSERT_RETURN, std::atomic::compare_exchange_strong(), and std::atomic::load().
Referenced by Ase::AtomicIntrusiveStack< T >::push().