MCPcopy Create free account
hub / github.com/Snapchat/Valdi / lockFreeRemoveTask

Method lockFreeRemoveTask

valdi_core/src/valdi_core/cpp/Threading/TaskQueue.cpp:116–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116DispatchFunction TaskQueue::lockFreeRemoveTask(task_id_t taskId) {
117 for (auto i = _tasks.begin(); i != _tasks.end(); ++i) {
118 if (i->id == taskId) {
119 auto task = std::move(*i);
120 _tasks.erase(i);
121 return std::move(task.function);
122 }
123 }
124
125 return DispatchFunction();
126}
127
128void TaskQueue::barrier(const DispatchFunction& function) {
129 auto executeTime = std::chrono::steady_clock::now();

Callers

nothing calls this directly

Calls 4

DispatchFunctionClass · 0.85
endMethod · 0.65
beginMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected