| 28 | } |
| 29 | |
| 30 | SystemStatus TaskSystem::Update(const double) { |
| 31 | for (ThreadPtr& thread : taskThreads_) { |
| 32 | if (thread->Idle()) { |
| 33 | thread->Dispatch(); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | auto ul = std::unique_lock<std::mutex>(m_); |
| 38 | if (waiting_.size() == 0) return SystemStatus::SYSTEM_CONTINUE; |
| 39 | |
| 40 | std::vector<TaskWait_ *> waiting; |
| 41 | for (TaskWait_* wait : waiting_) { |
| 42 | if (wait->CheckForCompletion()) { |
| 43 | delete wait; |
| 44 | } |
| 45 | else { |
| 46 | waiting.push_back(wait); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | waiting_ = std::move(waiting); |
| 51 | |
| 52 | return SystemStatus::SYSTEM_CONTINUE; |
| 53 | } |
| 54 | |
| 55 | void TaskSystem::Shutdown() { |
| 56 | bool allIdle = false; |
nothing calls this directly
no test coverage detected