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

Method cancel

source/timers/timer.cpp:69–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void timer::cancel() {
70 if (!static_cast<bool>(m_state)) {
71 return;
72 }
73
74 auto state = std::move(m_state);
75 state->cancel();
76
77 auto timer_queue = state->get_timer_queue().lock();
78
79 if (!static_cast<bool>(timer_queue)) {
80 return;
81 }
82
83 timer_queue->remove_internal_timer(std::move(state));
84}
85
86void timer::set_frequency(std::chrono::milliseconds new_frequency) {
87 throw_if_empty(details::consts::k_timer_empty_set_frequency_err_msg);

Calls 3

lockMethod · 0.80
get_timer_queueMethod · 0.80
remove_internal_timerMethod · 0.80