MCPcopy Create free account
hub / github.com/MariaDB/server / timer_callback

Method timer_callback

tpool/tpool_win.cc:81–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 bool m_on;
80
81 static void CALLBACK timer_callback(PTP_CALLBACK_INSTANCE callback_instance, void *context,
82 PTP_TIMER callback_timer)
83 {
84 native_timer *timer= (native_timer *) context;
85 tls_data.callback_prolog(&timer->m_pool);
86 std::unique_lock<std::mutex> lk(timer->m_mtx, std::defer_lock);
87 if (!lk.try_lock())
88 {
89 /* Do not try to run timers in parallel */
90 return;
91 }
92 timer->m_func(timer->m_data);
93 if (timer->m_period)
94 timer->set_time(timer->m_period, timer->m_period);
95 }
96
97 public:
98 native_timer(thread_pool_win& pool, callback_func func, void* data) :

Callers

nothing calls this directly

Calls 3

callback_prologMethod · 0.80
try_lockMethod · 0.45
set_timeMethod · 0.45

Tested by

no test coverage detected