about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/timer_create.c
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/timer_create.c
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/timer_create.c')
-rw-r--r--sysdeps/unix/sysv/linux/timer_create.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/timer_create.c b/sysdeps/unix/sysv/linux/timer_create.c
index 1ea0086487..b21b0ca949 100644
--- a/sysdeps/unix/sysv/linux/timer_create.c
+++ b/sysdeps/unix/sysv/linux/timer_create.c
@@ -74,8 +74,8 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
     else
       {
 	/* Create the helper thread.  */
-	pthread_once (&__helper_once, __start_helper_thread);
-	if (__helper_tid == 0)
+	pthread_once (&__timer_helper_once, __timer_start_helper_thread);
+	if (__timer_helper_tid == 0)
 	  {
 	    /* No resources to start the helper thread.  */
 	    __set_errno (EAGAIN);
@@ -118,7 +118,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
 	  { .sigev_value.sival_ptr = newp,
 	    .sigev_signo = SIGTIMER,
 	    .sigev_notify = SIGEV_SIGNAL | SIGEV_THREAD_ID,
-	    ._sigev_un = { ._pad = { [0] = __helper_tid } } };
+	    ._sigev_un = { ._pad = { [0] = __timer_helper_tid } } };
 
 	/* Create the timer.  */
 	int res;
@@ -132,10 +132,10 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
 	  }
 
 	/* Add to the queue of active timers with thread delivery.  */
-	pthread_mutex_lock (&__active_timer_sigev_thread_lock);
-	newp->next = __active_timer_sigev_thread;
-	__active_timer_sigev_thread = newp;
-	pthread_mutex_unlock (&__active_timer_sigev_thread_lock);
+	pthread_mutex_lock (&__timer_active_sigev_thread_lock);
+	newp->next = __timer_active_sigev_thread;
+	__timer_active_sigev_thread = newp;
+	pthread_mutex_unlock (&__timer_active_sigev_thread_lock);
 
 	*timerid = timer_to_timerid (newp);
       }