#include <OgreHapticsConcurrentQueue.h>
Public Member Functions | |
ConcurrentQueue () | |
Standard constructor. | |
~ConcurrentQueue () | |
Standard destructor. | |
HazardPtr * | allocateHazardPtr (void) |
Allocates a HazardPtr for the queue instance to be used by the calling thread. | |
void | retireHazardPtr (HazardPtr *ptr) |
Marks the given HazardPtr to be available for reuse by other threads. | |
void | push (HazardPtr *ptr, const T &value) |
Inserts the given value at the back of the queue in a thread-safe manner. | |
bool | pop (HazardPtr *ptr, T &destination) |
Pops an entry from the queue in a thread-safe manner. | |
Classes | |
class | HazardPtr |
HazardPtr provides a safe mechanism for threads to advertise to all other threads making use of the same data structure about their memory usage. More... | |
struct | Node |
The implementation is lock-free if the atomic primitive compare-and-swap is lock-free.
Definition at line 62 of file OgreHapticsConcurrentQueue.h.
OgreHaptics::ConcurrentQueue< T >::ConcurrentQueue | ( | ) |
OgreHaptics::ConcurrentQueue< T >::~ConcurrentQueue | ( | ) |
Standard destructor.
Definition at line 154 of file OgreHapticsConcurrentQueue.h.
HazardPtr* OgreHaptics::ConcurrentQueue< T >::allocateHazardPtr | ( | void | ) |
Allocates a HazardPtr for the queue instance to be used by the calling thread.
All allocated HazardPtrs must be retired if the thread wishes to no longer use the queue.
Definition at line 187 of file OgreHapticsConcurrentQueue.h.
void OgreHaptics::ConcurrentQueue< T >::retireHazardPtr | ( | HazardPtr * | ptr | ) |
Marks the given HazardPtr to be available for reuse by other threads.
Definition at line 229 of file OgreHapticsConcurrentQueue.h.
void OgreHaptics::ConcurrentQueue< T >::push | ( | HazardPtr * | ptr, | |
const T & | value | |||
) |
Inserts the given value at the back of the queue in a thread-safe manner.
ptr | Pointer to the hazard pointer owned by the thread in which the operation is called. | |
value | Reference of the value to insert. |
Definition at line 247 of file OgreHapticsConcurrentQueue.h.
bool OgreHaptics::ConcurrentQueue< T >::pop | ( | HazardPtr * | ptr, | |
T & | destination | |||
) |
Pops an entry from the queue in a thread-safe manner.
ptr | Pointer to the hazard pointer owned by the thread in which the operation is called. | |
destination | Reference to the variable to which the entry will be assigned when popping was successful. |
true
if the destination value has been set successfully (e.g. the queue was not empty), false
otherwise. Definition at line 302 of file OgreHapticsConcurrentQueue.h.
Last modified Tue Jan 6 22:31:25 2009