MCPcopy Create free account
hub / github.com/KTStephano/StratusGFX / Update

Method Update

Source/Engine/StratusTaskSystem.cpp:30–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 3

IdleMethod · 0.80
DispatchMethod · 0.80
CheckForCompletionMethod · 0.80

Tested by

no test coverage detected