about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/kernel-posix-timers.h
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-06-25 10:51:31 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-06-25 12:21:12 +0200
commit2c16cb88a6e5ace0fb7cedca86860ea7bde522a7 (patch)
tree8e7aa16a33590ccd27050ef3d3b00607b7f15751 /sysdeps/unix/sysv/linux/kernel-posix-timers.h
parent1a5a653be2f95d4d9485d08672dc5083c74c39d8 (diff)
downloadglibc-2c16cb88a6e5ace0fb7cedca86860ea7bde522a7.tar.gz
glibc-2c16cb88a6e5ace0fb7cedca86860ea7bde522a7.tar.xz
glibc-2c16cb88a6e5ace0fb7cedca86860ea7bde522a7.zip
Linux: Move timer helper routines from librt to libc
This adds several temporary GLIBC_PRIVATE exports.  The symbol names
are changed so that they all start with __timer_.

It is now possible to invoke the fork handler directly, so
pthread_atfork is no longer necessary.  The associated error cannot
happen anymore, and cancellation handling can be removed from
the helper thread routine.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/kernel-posix-timers.h')
-rw-r--r--sysdeps/unix/sysv/linux/kernel-posix-timers.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/kernel-posix-timers.h b/sysdeps/unix/sysv/linux/kernel-posix-timers.h
index 959a81a4d2..17fc32d48f 100644
--- a/sysdeps/unix/sysv/linux/kernel-posix-timers.h
+++ b/sysdeps/unix/sysv/linux/kernel-posix-timers.h
@@ -26,19 +26,27 @@
 extern int __no_posix_timers attribute_hidden;
 
 /* Callback to start helper thread.  */
-extern void __start_helper_thread (void) attribute_hidden;
+extern void __timer_start_helper_thread (void);
+libc_hidden_proto (__timer_start_helper_thread)
 
 /* Control variable for helper thread creation.  */
-extern pthread_once_t __helper_once attribute_hidden;
+extern pthread_once_t __timer_helper_once;
+libc_hidden_proto (__timer_helper_once)
+
+/* Called from fork so that the new subprocess re-creates the
+   notification thread if necessary.  */
+void __timer_fork_subprocess (void) attribute_hidden;
 
 /* TID of the helper thread.  */
-extern pid_t __helper_tid attribute_hidden;
+extern pid_t __timer_helper_tid;
+libc_hidden_proto (__timer_helper_tid)
 
 /* List of active SIGEV_THREAD timers.  */
-extern struct timer *__active_timer_sigev_thread attribute_hidden;
-/* Lock for the __active_timer_sigev_thread.  */
-extern pthread_mutex_t __active_timer_sigev_thread_lock attribute_hidden;
-
+extern struct timer *__timer_active_sigev_thread;
+libc_hidden_proto (__timer_active_sigev_thread)
+/* Lock for __timer_active_sigev_thread.  */
+extern pthread_mutex_t __timer_active_sigev_thread_lock;
+libc_hidden_proto (__timer_active_sigev_thread_lock)
 
 /* Type of timers in the kernel.  */
 typedef int kernel_timer_t;