MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / stop_timer

Method stop_timer

src/dpp/cluster/timer.cpp:45–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45bool cluster::stop_timer(timer t) {
46 /*
47 * Because iterating a priority queue is at best O(log n) we don't actually walk the queue
48 * looking for the timer to remove. Instead, we just insert the timer handle into a std::set
49 * to inform the tick_timers() function later if it sees a handle in this set, it is to
50 * have its on_stop() called and it is not to be rescheduled.
51 */
52 std::lock_guard<std::mutex> l(timer_guard);
53 deleted_timers.emplace(t);
54 return true;
55}
56
57void cluster::tick_timers() {
58 time_t now = time(nullptr);

Callers 11

mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
handle_frameMethod · 0.80
~ssl_connectionMethod · 0.80
on_disconnectMethod · 0.80
oneshot_timerMethod · 0.80
cancelMethod · 0.80
timed_listenerMethod · 0.80
~timed_listenerMethod · 0.80

Calls 1

emplaceMethod · 0.80

Tested by 1

mainFunction · 0.64