2.9
[glibc/nacl-glibc.git] / nptl / sysdeps / unix / sysv / linux / kernel-posix-timers.h
blob5f419c214498ca157fe64619e11944aa39e27481
1 /* Copyright (C) 2003, 2007 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
20 #include <pthread.h>
21 #include <setjmp.h>
22 #include <signal.h>
23 #include <sys/types.h>
26 /* Nonzero if the system calls are not available. */
27 extern int __no_posix_timers attribute_hidden;
29 /* Callback to start helper thread. */
30 extern void __start_helper_thread (void) attribute_hidden;
32 /* Control variable for helper thread creation. */
33 extern pthread_once_t __helper_once attribute_hidden;
35 /* TID of the helper thread. */
36 extern pid_t __helper_tid attribute_hidden;
38 /* List of active SIGEV_THREAD timers. */
39 extern struct timer *__active_timer_sigev_thread attribute_hidden;
40 /* Lock for the __active_timer_sigev_thread. */
41 extern pthread_mutex_t __active_timer_sigev_thread_lock attribute_hidden;
44 /* Type of timers in the kernel. */
45 typedef int kernel_timer_t;
48 /* Internal representation of timer. */
49 struct timer
51 /* Notification mechanism. */
52 int sigev_notify;
54 /* Timer ID returned by the kernel. */
55 kernel_timer_t ktimerid;
57 /* All new elements must be added after ktimerid. And if the thrfunc
58 element is not the third element anymore the memory allocation in
59 timer_create needs to be changed. */
61 /* Parameters for the thread to be started for SIGEV_THREAD. */
62 void (*thrfunc) (sigval_t);
63 sigval_t sival;
64 pthread_attr_t attr;
66 /* Next element in list of active SIGEV_THREAD timers. */
67 struct timer *next;