Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZStd::lock_free_stamped_stack< T, Allocator > Class Template Reference

#include <lock_free_stamped_stack.h>

Public Types

typedef T * pointer
 
typedef const T * const_pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef Allocator::difference_type difference_type
 
typedef Allocator::size_type size_type
 
typedef Allocator allocator_type
 
typedef T value_type
 
typedef Internal::lock_free_stack_node< T > node_type
 
typedef node_type * node_ptr_type
 

Public Member Functions

void push (const_reference value)
 Pushes a value onto the top of the stack.
 
bool pop (pointer value_out)
 
bool empty () const
 Tests if the stack is empty, limited utility for a concurrent container.
 

Detailed Description

template<typename T, typename Allocator>
class AZStd::lock_free_stamped_stack< T, Allocator >

A lock-free stack implementation, uses stamped references to avoid the ABA problem. Requires an allocator, which must also be lock-free, and allow stale reads. It may recycle allocations concurrently.

Member Function Documentation

◆ pop()

template<typename T , typename Allocator >
bool AZStd::lock_free_stamped_stack< T, Allocator >::pop ( pointer  value_out)
inline

Attempts to pop a value from the top of the stack. Returns false if the stack was empty, otherwise popped value is stored in value_out and returns true.


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