| 32 | */ |
| 33 | |
| 34 | static void * |
| 35 | timer_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 | /** |
nothing calls this directly
no test coverage detected