MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / wait

Method wait

external/nvImageCodec/src/thread_pool.cpp:122–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 void ThreadPool::wait(bool checkForErrors) {
123 std::unique_lock<std::mutex> lock(mutex_);
124 if (!started_)
125 return;
126 completed_.wait(lock, [this] { return this->work_complete_; });
127 started_ = false;
128 if (checkForErrors) {
129 // Check for errors
130 for (size_t i = 0; i < threads_.size(); ++i) {
131 if (!tl_errors_[i].empty()) {
132 // Throw the first error that occurred
133 std::stringstream ss;
134 ss << "Error in thread " << i << ": " << tl_errors_[i].front();
135 std::string error = ss.str();
136 tl_errors_[i].pop();
137 throw std::runtime_error(error);
138 }
139 }
140 }
141 }
142
143 int ThreadPool::getThreadsNum() const {
144 return threads_.size();

Callers 9

operator()Method · 0.45
processMethod · 0.45
threadMainMethod · 0.45
BlockParallelExecFunction · 0.45
AcquireMethod · 0.45
WaitMethod · 0.45
~ZepMode_SearchMethod · 0.45
ThreadPoolMethod · 0.45

Calls 5

strMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected