MCPcopy Create free account
hub / github.com/daniele77/cli / ExecOne

Method ExecOne

include/cli/loopscheduler.h:84–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 }
83
84 bool ExecOne()
85 {
86 std::function<void()> task;
87 {
88 std::unique_lock<std::mutex> lck(mtx);
89 cv.wait(lck, [this](){ return !running || !tasks.empty(); });
90 if (!running)
91 return false;
92 task = tasks.front();
93 tasks.pop();
94 }
95
96 if (task)
97 task();
98
99 return true;
100 }
101
102 bool PollOne()
103 {

Callers 3

SchedulingTestFunction · 0.45
SameThreadTestFunction · 0.45
ExceptionTestFunction · 0.45

Calls

no outgoing calls

Tested by 3

SchedulingTestFunction · 0.36
SameThreadTestFunction · 0.36
ExceptionTestFunction · 0.36