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

Method add_timer

source/timers/timer_queue.cpp:177–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void timer_queue::add_timer(std::unique_lock<std::mutex>& lock, timer_ptr new_timer) {
178 assert(lock.owns_lock());
179
180 if (m_abort) {
181 throw errors::runtime_shutdown(details::consts::k_timer_queue_shutdown_err_msg);
182 }
183
184 auto old_thread = ensure_worker_thread(lock);
185 add_internal_timer(lock, new_timer);
186
187 if (old_thread.joinable()) {
188 old_thread.join();
189 }
190}
191
192void timer_queue::work_loop() {
193 time_point next_deadline;

Callers

nothing calls this directly

Calls 3

owns_lockMethod · 0.80
joinableMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected