| 118 | } |
| 119 | |
| 120 | void 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 | |
| 139 | Thread* ThreadPool::isOneThreadFinished(std::map<Thread*, bool>& thread_map) |
| 140 | { |
nothing calls this directly
no test coverage detected