Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ase::AtomicIntrusiveStack< T > Class Template Reference

#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 ()
 

Detailed Description

template<class T>
class Ase::AtomicIntrusiveStack< T >

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.

Constructor & Destructor Documentation

◆ AtomicIntrusiveStack()

template<class T >
Ase::AtomicIntrusiveStack< T >::AtomicIntrusiveStack ( )

Definition at line 25 of file atomics.hh.

Member Function Documentation

◆ empty()

template<class T >
bool Ase::AtomicIntrusiveStack< T >::empty ( ) const

Check if poppingreturns null.

Definition at line 32 of file atomics.hh.

References std::atomic::load().

◆ pop_all()

template<class T >
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().

◆ pop_reversed()

template<class T >
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().

◆ push()

template<class T >
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().

◆ push_chain()

template<class T >
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().


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