Lines Matching refs:threads
109 Array<thread*> threads; member
115 threads.reserve(threadCnt); in TaskSchedulerImpl()
120 threads.push(new thread); in TaskSchedulerImpl()
123 *threads.data[i] = thread([&, i] { run(i); }); in TaskSchedulerImpl()
132 for (auto thread = threads.begin(); thread < threads.end(); ++thread) { in ~TaskSchedulerImpl()
148 for (uint32_t x = 0; x < threads.count * 2; ++x) { in run()
149 if (taskQueues[(i + x) % threads.count]->tryPop(&task)) { in run()
163 if (threads.count > 0 && _async) { in request()
166 for (uint32_t n = 0; n < threads.count; ++n) { in request()
167 if (taskQueues[(i + n) % threads.count]->tryPush(task)) return; in request()
169 taskQueues[i % threads.count]->push(task); in request()
178 return threads.count; in threadCnt()
201 void TaskScheduler::init(uint32_t threads) in init() argument
204 inst = new TaskSchedulerImpl(threads); in init()
221 uint32_t TaskScheduler::threads() in threads() function in TaskScheduler