| 252 | |
| 253 | template<typename TDatums, typename TQueue> |
| 254 | bool QueueBase<TDatums, TQueue>::waitAndPop(TDatums& tDatums) |
| 255 | { |
| 256 | try |
| 257 | { |
| 258 | std::unique_lock<std::mutex> lock{mMutex}; |
| 259 | mConditionVariable.wait(lock, [this]{return !mTQueue.empty() || mPopIsStopped; }); |
| 260 | return pop(tDatums); |
| 261 | } |
| 262 | catch (const std::exception& e) |
| 263 | { |
| 264 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 265 | return false; |
| 266 | } |
| 267 | } |
| 268 | |
| 269 | template<typename TDatums, typename TQueue> |
| 270 | bool QueueBase<TDatums, TQueue>::waitAndPop() |