MCPcopy Create free account
hub / github.com/David-Haim/concurrencpp / wait_for_tasks_impl

Method wait_for_tasks_impl

source/executors/manual_executor.cpp:130–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void manual_executor::wait_for_tasks_impl(size_t count) {
131 if (count == 0) {
132 if (shutdown_requested()) {
133 details::throw_runtime_shutdown_exception(name);
134 }
135 return;
136 }
137
138 std::unique_lock<decltype(m_lock)> lock(m_lock);
139 m_condition.wait(lock, [this, count] {
140 return (m_tasks.size() >= count) || m_abort;
141 });
142
143 if (m_abort) {
144 details::throw_runtime_shutdown_exception(name);
145 }
146
147 assert(m_tasks.size() >= count);
148}
149
150size_t manual_executor::wait_for_tasks_impl(size_t count, std::chrono::time_point<std::chrono::system_clock> deadline) {
151 deadline += std::chrono::milliseconds(1);

Callers

nothing calls this directly

Calls 4

shutdown_requestedFunction · 0.85
waitMethod · 0.45
sizeMethod · 0.45
wait_untilMethod · 0.45

Tested by

no test coverage detected