MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / _main

Method _main

src/thread_pool.h:100–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99 public:
100 void _main() {
101 while (_continue) {
102 if (auto task = this->pop()) {
103 (*task)->run();
104 } else {
105 std::unique_lock uniq_lock(_lock);
106
107 if (ready()) {
108 continue;
109 }
110
111 if (!_continue) {
112 break;
113 }
114
115 if (auto tp = next()) {
116 _cv.wait_until(uniq_lock, *tp);
117 } else {
118 _cv.wait(uniq_lock);
119 }
120 }
121 }
122
123 // Execute remaining tasks
124 while (auto task = this->pop()) {
125 (*task)->run();
126 }
127 }
128 };
129} // namespace thread_pool_util

Callers

nothing calls this directly

Calls 4

runMethod · 0.80
wait_untilMethod · 0.80
waitMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected