MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / checkOneThreadFinished

Method checkOneThreadFinished

src/ThreadPool.cpp:120–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120void ThreadPool::checkOneThreadFinished(std::map<Thread*, bool>& thread_map)
121{
122 Thread* finished_thread = isOneThreadFinished(thread_map);
123 if (NULL != finished_thread) {
124 if (thrPoolManager->getFlags() & ThreadPoolManager::VERBOSE) {
125 long long duration_usec = finished_thread->duration() ;
126 long long duration_sec = duration_usec / 1000000;
127 thrPoolManager->lock();
128 std::cout << "Thread terminated [" << getName() << "#" << finished_thread->getNumber() << ":" << finished_thread->getThreadSelf() << "] in [" << duration_sec << "." << (duration_usec - duration_sec*1000000) << " secs]" << std::endl;
129 thrPoolManager->unlock();
130 }
131 thread_map.erase(thread_map.find(finished_thread));
132 thrPoolManager->releaseOneThread();
133 if (finished_thread->deleteArg()) {
134 delete finished_thread->getArg();
135 }
136 }
137}
138
139Thread* ThreadPool::isOneThreadFinished(std::map<Thread*, bool>& thread_map)
140{

Callers

nothing calls this directly

Calls 9

getFlagsMethod · 0.80
durationMethod · 0.80
lockMethod · 0.80
getNumberMethod · 0.80
getThreadSelfMethod · 0.80
unlockMethod · 0.80
releaseOneThreadMethod · 0.80
deleteArgMethod · 0.80
getArgMethod · 0.80

Tested by

no test coverage detected