#include "atomics.hh"
Public Member Functions | |
AtomicIntrusiveStack () | |
bool | empty () const |
T * | pop_all () |
T * | pop_reversed () |
bool | push (T *el) |
bool | push_chain (T *first, T *last) |
Lock-free stack with atomic `push()` and `pop_all` operations. Relies on unqualified calls to `atomic<T*>& atomic_next_ptrref(T*)`.
AtomicIntrusiveStack | ( | ) |
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 | ( | ) |
Atomically pop all elements from the stack in LIFO order. Use `atomic_next_ptrref()` for iteration.
T * pop_reversed | ( | ) |
Atomically pop all elements from the stack in FIFO order. Use `atomic_next_ptrref()` for iteration.