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

Method waitAndPush

include/openpose/thread/queueBase.hpp:208–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206
207 template<typename TDatums, typename TQueue>
208 bool QueueBase<TDatums, TQueue>::waitAndPush(const TDatums& tDatums)
209 {
210 try
211 {
212 std::unique_lock<std::mutex> lock{mMutex};
213 mConditionVariable.wait(lock, [this]{return mTQueue.size() < getMaxSize() || mPushIsStopped; });
214 return push(tDatums);
215 }
216 catch (const std::exception& e)
217 {
218 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
219 return false;
220 }
221 }
222
223 template<typename TDatums, typename TQueue>
224 bool QueueBase<TDatums, TQueue>::tryPop(TDatums& tDatums)

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected