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

Method PollOne

include/cli/loopscheduler.h:102–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 }
101
102 bool PollOne()
103 {
104 std::function<void()> task;
105 {
106 std::lock_guard<std::mutex> lck(mtx);
107 if (!running || tasks.empty())
108 return false;
109 task = tasks.front();
110 tasks.pop();
111 }
112
113 if (task)
114 task();
115
116 return true;
117 }
118
119private:
120 std::queue<std::function<void()>> tasks;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected