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

Method threadFunction

include/openpose/thread/thread.hpp:178–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176
177 template<typename TDatums, typename TWorker>
178 void Thread<TDatums, TWorker>::threadFunction()
179 {
180 try
181 {
182 opLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
183 initializationOnThread();
184
185 opLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
186 while (isRunning())
187 {
188 bool allSubThreadsClosed = true;
189 for (auto& subThread : mSubThreads)
190 allSubThreadsClosed &= !subThread->work();
191
192 if (allSubThreadsClosed)
193 {
194 opLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
195 stop();
196 break;
197 }
198 }
199 opLog("", Priority::Low, __LINE__, __FUNCTION__, __FILE__);
200 }
201 catch (const std::exception& e)
202 {
203 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
204 }
205 }
206
207 template<typename TDatums, typename TWorker>
208 void Thread<TDatums, TWorker>::stop()

Callers

nothing calls this directly

Calls 4

whatMethod · 0.80
opLogFunction · 0.50
errorFunction · 0.50
workMethod · 0.45

Tested by

no test coverage detected