MCPcopy Create free account
hub / github.com/RenderKit/embree / thread_loop

Method thread_loop

common/tasking/taskschedulerinternal.cpp:212–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210 }
211
212 void TaskScheduler::ThreadPool::thread_loop(size_t globalThreadIndex)
213 {
214 while (globalThreadIndex < numThreadsRunning)
215 {
216 Ref<TaskScheduler> scheduler = NULL;
217 ssize_t threadIndex = -1;
218 {
219 Lock<MutexSys> lock(mutex);
220 condition.wait(mutex, [&] () { return globalThreadIndex >= numThreadsRunning || !schedulers.empty(); });
221 if (globalThreadIndex >= numThreadsRunning) break;
222 scheduler = schedulers.front();
223 threadIndex = scheduler->allocThreadIndex();
224 }
225 scheduler->thread_loop(threadIndex);
226 }
227 }
228
229 TaskScheduler::TaskScheduler()
230 : threadCounter(0), anyTasksRunning(0), hasRootTask(false)

Callers 1

threadPoolFunctionFunction · 0.80

Calls 7

yieldFunction · 0.85
_mm_pauseFunction · 0.85
allocThreadIndexMethod · 0.80
waitMethod · 0.45
emptyMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected