43 #include <condition_variable>
61 std::unique_lock<std::mutex> lock (mutex_);
73 std::unique_lock<std::mutex> lock (mutex_);
75 while (queue_.empty () && (!request_to_end_))
86 result = queue_.front ();
95 std::unique_lock<std::mutex> lock (mutex_);
96 request_to_end_ =
true;
103 std::unique_lock<std::mutex> lock (mutex_);
104 return static_cast<unsigned int> (queue_.size ());
110 std::unique_lock<std::mutex> lock (mutex_);
111 return (queue_.empty ());
118 enqueue_data_ =
false;
120 while (!queue_.empty ())
126 std::queue<T> queue_;
127 mutable std::mutex mutex_;
128 std::condition_variable cond_;
130 bool request_to_end_{
false};
131 bool enqueue_data_{
true};
void enqueue(const T &data)