MCPcopy Create free account
hub / github.com/OAID/Tengine / GetTask

Method GetTask

core/include/worker_thread.hpp:185–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183 }
184
185 bool GetTask(T& task)
186 {
187 bool ret=false;
188 std::unique_lock<std::mutex> cv_lock(*worker_lock_);
189
190 if(bind_cpu_==dispatch_cpu_)
191 {
192 if(task_queue_->empty() && !quit_work_)
193 worker_cv_->wait(cv_lock, [this] { return !task_queue_->empty() || quit_work_; });
194 }
195
196 if(!task_queue_->empty())
197 {
198 task = task_queue_->front();
199 task_queue_->pop();
200 ret=true;
201 }
202
203 cv_lock.unlock();
204
205 return ret;
206 }
207
208 void Init(const process_t& func)
209 {

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected