fix regression from a745c4bfc8a9b5db4e48387170da0dc1d39e3abe
[uclibc-ng.git] / librt / kernel-posix-timers.h
blobf8bfdc2ae556ccbf51dc5c8c61b8a723caf32ecf
1 /*
2 * kernel-posix-timers.h - kernel-dependent definitions for POSIX timers.
3 */
5 #include <features.h>
6 #include <setjmp.h>
7 #include <signal.h>
8 #include <sys/types.h>
9 #ifdef __UCLIBC_HAS_THREADS__
10 #include <pthread.h>
11 #endif
13 #ifdef __UCLIBC_HAS_THREADS_NATIVE__
14 /* Nonzero if the system calls are not available. */
15 extern int __no_posix_timers attribute_hidden;
17 /* Callback to start helper thread. */
18 extern void __start_helper_thread (void) attribute_hidden;
20 /* Control variable for helper thread creation. */
21 extern pthread_once_t __helper_once attribute_hidden;
23 /* TID of the helper thread. */
24 extern pid_t __helper_tid attribute_hidden;
26 /* List of active SIGEV_THREAD timers. */
27 extern struct timer *__active_timer_sigev_thread attribute_hidden;
28 /* Lock for the __active_timer_sigev_thread. */
29 extern pthread_mutex_t __active_timer_sigev_thread_lock attribute_hidden;
30 #endif
32 /* Type of timers in the kernel */
33 typedef int kernel_timer_t;
35 /* Internal representation of timer */
36 struct timer {
37 /* Notification mechanism */
38 int sigev_notify;
40 /* Timer ID returned by the kernel */
41 kernel_timer_t ktimerid;
44 * All new elements must be added after ktimerid. And if the thrfunc
45 * element is not the third element anymore the memory allocation in
46 * timer_create needs to be changed.
49 /* Parameters for the thread to be started for SIGEV_THREAD */
50 void (*thrfunc) (sigval_t);
51 sigval_t sival;
52 #ifdef __UCLIBC_HAS_THREADS__
53 pthread_attr_t attr;
54 #endif
56 /* Next element in list of active SIGEV_THREAD timers. */
57 struct timer *next;