| 156 | |
| 157 | template<typename TDatums, typename TQueue> |
| 158 | bool QueueBase<TDatums, TQueue>::waitAndEmplace(TDatums& tDatums) |
| 159 | { |
| 160 | try |
| 161 | { |
| 162 | std::unique_lock<std::mutex> lock{mMutex}; |
| 163 | mConditionVariable.wait(lock, [this]{return mTQueue.size() < getMaxSize() || mPushIsStopped; }); |
| 164 | return emplace(tDatums); |
| 165 | } |
| 166 | catch (const std::exception& e) |
| 167 | { |
| 168 | error(e.what(), __LINE__, __FUNCTION__, __FILE__); |
| 169 | return false; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | template<typename TDatums, typename TQueue> |
| 174 | bool QueueBase<TDatums, TQueue>::forcePush(const TDatums& tDatums) |