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

Function CreateAsyncVoidTask_

Source/Engine/StratusTaskSystem.h:79–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 }
78
79 Async<void> CreateAsyncVoidTask_(const std::function<void (void)>& process, const size_t index) {
80 // Increment the working #
81 threadsWorking_[index]->fetch_add(1);
82
83 const auto processWithHook = [this, index, process]() {
84 process();
85 // Decrement working counter
86 threadsWorking_[index]->fetch_sub(1);
87 };
88
89 auto as = Async<void>(*taskThreads_[index].get(), processWithHook);
90 return as;
91 }
92
93 size_t GetNextThreadIndexForTask_() {
94 if (taskThreads_.size() == 0) throw std::runtime_error("Task threads size equal to 0");

Callers 1

ScheduleVoidTask_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected