MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateThreads

Method CreateThreads

tensorflow/lite/experimental/ruy/thread_pool.cc:183–192  ·  view source on GitHub ↗

Ensures that the pool has at least the given count of threads. If any new thread has to be created, this function waits for it to be ready.

Source from the content-addressed store, hash-verified

181// If any new thread has to be created, this function waits for it to
182// be ready.
183void ThreadPool::CreateThreads(int threads_count) {
184 if (threads_.size() >= threads_count) {
185 return;
186 }
187 counter_to_decrement_when_ready_.Reset(threads_count - threads_.size());
188 while (threads_.size() < threads_count) {
189 threads_.push_back(new Thread(&counter_to_decrement_when_ready_));
190 }
191 counter_to_decrement_when_ready_.Wait();
192}
193
194ThreadPool::~ThreadPool() {
195 for (auto w : threads_) {

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
ResetMethod · 0.45
push_backMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected