FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
template<typename Data>
void FB::SafeQueue< Data >::wait_and_pop ( Data &  popped_value)
inline

Tries to pop a value off the front of the queue; if the queue is empty it will wait indefinitely until something is pushed onto the back of the queue by another thread.

Parameters
[out]popped_valueThe popped value.

Definition at line 127 of file SafeQueue.h.

128  {
129  boost::mutex::scoped_lock lock(the_mutex);
130  while(the_queue.empty())
131  {
132  the_condition_variable.wait(lock);
133  }
134 
135  popped_value=the_queue.front();
136  the_queue.pop();
137  }