eXpress “1.5”
|
The ThreadSafeFragQueue is a threadsafe queue of Fragment pointers. More...
#include <threadsafety.h>
Public Member Functions | |
ThreadSafeFragQueue (size_t max_size) | |
ThreadSafeFragQueue Constructor. | |
Fragment * | pop (bool block=true) |
A member function that pops the next Fragment pointer off the queue. | |
void | push (Fragment *frag) |
A member function that pushes the given Fragment pointer onto the queue. | |
bool | is_empty (bool block=false) |
A member function that returns true iff the queue is empty. |
The ThreadSafeFragQueue is a threadsafe queue of Fragment pointers.
Definition at line 23 of file threadsafety.h.
ThreadSafeFragQueue::ThreadSafeFragQueue | ( | size_t | max_size | ) |
ThreadSafeFragQueue Constructor.
max_size | a size_t representing the number of Fragments allowed in |
the queue before blocking on a push.
Definition at line 12 of file threadsafety.cpp.
bool ThreadSafeFragQueue::is_empty | ( | bool | block = false | ) |
A member function that returns true iff the queue is empty.
If block is true, the function blocks until the queue is empty and returns true.
block | a bool specifying whether or not the function should block until the queue is empty. |
Definition at line 41 of file threadsafety.cpp.
Fragment * ThreadSafeFragQueue::pop | ( | bool | block = true | ) |
A member function that pops the next Fragment pointer off the queue.
If the queue is empty, returns NULL if block is false, otherwise blocks until one is available.
block | a bool specifying whether or not the function should block if the queue is empty. |
Definition at line 16 of file threadsafety.cpp.
void ThreadSafeFragQueue::push | ( | Fragment * | frag | ) |
A member function that pushes the given Fragment pointer onto the queue.
Blocks if the queue is full.
frag | the Fragment pointer to push onto the queue. |
Definition at line 31 of file threadsafety.cpp.