Torque3D Documentation / _generateds / ThreadSafeDeque

ThreadSafeDeque

Engine/source/platform/threads/threadSafeDeque.h

Fast, lock-free double-ended queue for concurrent access.

More...

Classes:

Public Types

T
ValueType 

Protected Types

NodeRef 

Protected Attributes

Free list for list nodes.

Reference to the head node.

Protected Functions

Public Functions

Construct an empty deque.

bool

Append the given value to the list.

Prepend the given value to the list.

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

return:

the leftmost node in the list.

note:

Updates the list state and may purge deleted nodes.

getTail()

return:

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

return:

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.