Definition at line 209 of file thread_pool_test.cc.
◆ SpawnTask()
Definition at line 211 of file thread_pool_test.cc.
212 : pool_(
pool), sync_(sync), todo_(todo), total_(total), done_(
done) {}
static void done(const char *config, const char *src, const char *srcOptions, const char *name)
◆ Run()
virtual void dart::SpawnTask::Run |
( |
| ) |
|
|
inlinevirtual |
Implements dart::ThreadPool::Task.
Definition at line 214 of file thread_pool_test.cc.
214 {
215 todo_--;
216 int child_todo = todo_ / 2;
217
218
219 if (todo_ > 0) {
220 pool_->
Run<
SpawnTask>(pool_, sync_, todo_ - child_todo, total_, done_);
221 }
222 if (todo_ > 1) {
223 pool_->
Run<
SpawnTask>(pool_, sync_, child_todo, total_, done_);
224 }
225
226 {
227 MonitorLocker ml(sync_);
228 (*done_)++;
229 if (*done_ >= total_) {
230 ml.Notify();
231 }
232 }
233 }
SpawnTask(ThreadPool *pool, Monitor *sync, int todo, int total, int *done)
bool Run(Args &&... args)
The documentation for this class was generated from the following file: