MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / waitAndEmplace

Method waitAndEmplace

include/openpose/thread/queueBase.hpp:158–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers 2

workMethod · 0.45
workMethod · 0.45

Calls 4

waitMethod · 0.80
whatMethod · 0.80
errorFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected