| 55 | */ |
| 56 | |
| 57 | static void * |
| 58 | timer_notify_thread(void *arg) |
| 59 | { |
| 60 | sigset_t set; |
| 61 | siginfo_t info; |
| 62 | pthread_barrier_t *barrier= arg; |
| 63 | |
| 64 | my_thread_init(); |
| 65 | |
| 66 | sigemptyset(&set); |
| 67 | sigaddset(&set, MY_TIMER_EVENT_SIGNO); |
| 68 | sigaddset(&set, MY_TIMER_KILL_SIGNO); |
| 69 | |
| 70 | /* Get the thread ID of the current thread. */ |
| 71 | thread_id= (pid_t) syscall(SYS_gettid); |
| 72 | |
| 73 | /* Wake up parent thread, thread_id is available. */ |
| 74 | pthread_barrier_wait(barrier); |
| 75 | |
| 76 | while (1) |
| 77 | { |
| 78 | if (sigwaitinfo(&set, &info) < 0) |
| 79 | continue; |
| 80 | |
| 81 | if (info.si_signo == MY_TIMER_EVENT_SIGNO) |
| 82 | timer_notify_function(info.si_value); |
| 83 | else if (info.si_signo == MY_TIMER_KILL_SIGNO) |
| 84 | break; |
| 85 | } |
| 86 | |
| 87 | my_thread_end(); |
| 88 | |
| 89 | return NULL; |
| 90 | } |
| 91 | |
| 92 | |
| 93 | /** |
nothing calls this directly
no test coverage detected