* Start the next job in the schedule. */
| 31 | * Start the next job in the schedule. |
| 32 | */ |
| 33 | void LinkGraphSchedule::SpawnNext() |
| 34 | { |
| 35 | if (this->schedule.empty()) return; |
| 36 | LinkGraph *next = this->schedule.front(); |
| 37 | LinkGraph *first = next; |
| 38 | while (next->Size() < 2) { |
| 39 | this->schedule.splice(this->schedule.end(), this->schedule, this->schedule.begin()); |
| 40 | next = this->schedule.front(); |
| 41 | if (next == first) return; |
| 42 | } |
| 43 | assert(next == LinkGraph::Get(next->index)); |
| 44 | this->schedule.pop_front(); |
| 45 | if (LinkGraphJob::CanAllocateItem()) { |
| 46 | LinkGraphJob *job = new LinkGraphJob(*next); |
| 47 | job->SpawnThread(); |
| 48 | this->running.push_back(job); |
| 49 | } else { |
| 50 | NOT_REACHED(); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Check if the next job is supposed to be finished, but has not yet completed. |
no test coverage detected