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

Function make_timer_impl

include/concurrencpp/timers/timer_queue.h:58–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57 template<class callable_type>
58 timer_ptr make_timer_impl(size_t due_time,
59 size_t frequency,
60 std::shared_ptr<concurrencpp::executor> executor,
61 bool is_oneshot,
62 callable_type&& callable) {
63 assert(static_cast<bool>(executor));
64
65 using decayed_type = typename std::decay_t<callable_type>;
66
67 auto timer_state = std::make_shared<details::timer_state<decayed_type>>(due_time,
68 frequency,
69 std::move(executor),
70 weak_from_this(),
71 is_oneshot,
72 std::forward<callable_type>(callable));
73 {
74 std::unique_lock<std::mutex> lock(m_lock);
75 add_timer(lock, timer_state);
76 }
77
78 return timer_state;
79 }
80
81 void work_loop();
82

Callers 2

make_timerFunction · 0.85
make_one_shot_timerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected