MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / timer_notify_thread

Function timer_notify_thread

mysys/kqueue_timers.c:34–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32*/
33
34static void *
35timer_notify_thread(void *arg __attribute__((unused)))
36{
37 my_timer_t *timer;
38 struct kevent kev;
39
40 my_thread_init();
41
42 while (1)
43 {
44 if (kevent(kq_fd, NULL, 0, &kev, 1, NULL) < 0)
45 continue;
46
47 if (kev.filter == EVFILT_TIMER)
48 {
49 timer= kev.udata;
50 assert(timer->id == kev.ident);
51 timer->notify_function(timer);
52 }
53 else if (kev.filter == EVFILT_USER)
54 break;
55 }
56
57 my_thread_end();
58
59 return NULL;
60}
61
62
63/**

Callers

nothing calls this directly

Calls 3

my_thread_initFunction · 0.85
keventClass · 0.85
my_thread_endFunction · 0.85

Tested by

no test coverage detected