ThreadSafeDeque
Engine/source/platform/threads/threadSafeDeque.h
Fast, lock-free double-ended queue for concurrent access.
Classes:
List node.
Public Types
ValueType
Protected Types
NodeRef
Protected Attributes
Public Functions
Construct an empty deque.
bool
isEmpty()
bool
tryPopBack(ValueType & outValue)
Try to take the rightmost value from the deque.
bool
tryPopFront(ValueType & outValue)
Try to take the leftmost value from the deque.
Detailed Description
Fast, lock-free double-ended queue for concurrent access.
Parameters:
T | Type of list elements; must have default contructor. |
Public Types
typedef T ValueType
Protected Types
typedef ThreadSafeRef< Node > NodeRef
Protected Attributes
ThreadSafeFreeList< Node > mFreeList
Free list for list nodes.
NodeRef mHead
Reference to the head node.
NodeRef mTail
Protected Functions
getHead()
the leftmost node in the list.
note:Updates the list state and may purge deleted nodes.
getTail()
the rightmost node in the list.
note:Updates the list state and may purge deleted nodes.
Public Functions
ThreadSafeDeque()
Construct an empty deque.
~ThreadSafeDeque()
dumpDebug()
isEmpty()
true if the queue is empty.
pushBack(const ValueType & value)
Append the given value to the list.
pushFront(const ValueType & value)
Prepend the given value to the list.
tryPopBack(ValueType & outValue)
Try to take the rightmost value from the deque.
Fails if the deque is empty at the time the method tries to take a node from the list.
tryPopFront(ValueType & outValue)
Try to take the leftmost value from the deque.
Fails if the deque is empty at the time the method tries to take a node from the list.