#include <lock_free_intrusive_stack.h>
Public Types | |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
typedef AZStd::size_t | difference_type |
typedef AZStd::size_t | size_type |
typedef T | value_type |
typedef T | node_type |
typedef node_type * | node_ptr_type |
typedef lock_free_intrusive_stack_node< T > | hook_node_type |
typedef hook_node_type * | hook_node_ptr_type |
Public Member Functions | |
void | push (const_reference value) |
Pushes a value onto the top of the stack. | |
pointer | pop () |
bool | empty () const |
Tests if the stack is empty, limited utility for a concurrent container. | |
A lock-free intrusive stack implementation. The stored type must either inherit from lock_free_intrusive_stack_node or include it as a member, and the appropriate hook type must be specified.
IMPORTANT NOTE: This stack implementation is vulnerable to the ABA problem. Since the nodes are managed by the user, it is up to the user to ensure that the ABA problem does not occur. DO NOT USE THIS STACK UNLESS YOU THOROUGHLY UNDERSTAND THE ABA PROBLEM, YOU WILL RANDOMLY CORRUPT THE STACK AND CAUSE CRASHES. Use the lock_free_intrusive_stamped_stack instead as it does not suffer from the ABA problem.
|
inline |
Attempts to pop a value from the top of the stack. Returns NULL if the stack was empty, otherwise returns a pointer to the popped value