19 #ifndef _THREADSAFE_QUEUE_HPP_
20 #define _THREADSAFE_QUEUE_HPP_
22 #include <boost/shared_ptr.hpp>
23 #include <boost/thread/mutex.hpp>
24 #include <boost/thread/locks.hpp>
31 template <
class _qoT, >
39 void push(boost::shared_ptr<_qoT> p)
41 boost::lock_guard<boost::mutex> guard(queueMutex);
45 boost::shared_ptr<_qoT>
pop()
47 boost::lock_guard<boost::mutex> guard(queueMutex);
48 return queue->pop_front();
53 boost::lock_guard<boost::mutex> guard(queueMutex);
54 return queue->front();
57 boost::shared_ptr<_qoT>
back()
59 boost::lock_guard<boost::mutex> guard(queueMutex);
65 boost::lock_guard<boost::mutex> guard(queueMutex);
66 return queue->empty();
71 boost::lock_guard<boost::mutex> guard(queueMutex);
77 std::deque<boost::shared_ptr<_qoT> > queue;
78 boost::mutex queueMutex;
ThreadsafeQueue()
Definition: threadsafe_queue.hpp:35
bool empty()
Definition: threadsafe_queue.hpp:63
size_t size()
Definition: threadsafe_queue.hpp:69
~ThreadsafeQueue()
Definition: threadsafe_queue.hpp:37
boost::shared_ptr< _qoT > back()
Definition: threadsafe_queue.hpp:57
boost::shared_ptr< _qoT > front()
Definition: threadsafe_queue.hpp:51
void push(boost::shared_ptr< _qoT > p)
Definition: threadsafe_queue.hpp:39
Definition: threadsafe_queue.hpp:32
Definition: statable_queue.hpp:8
boost::shared_ptr< _qoT > pop()
Definition: threadsafe_queue.hpp:45