]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/pthread/timer_routines.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / sysdeps / pthread / timer_routines.c
index 940db62b25fedb583fca1f918debff99e59a0d36..670d0fe52b14495a72dd81b4636fe40471832117 100644 (file)
@@ -1,5 +1,5 @@
 /* Helper code for POSIX timer implementation on NPTL.
-   Copyright (C) 2000-2018 Free Software Foundation, Inc.
+   Copyright (C) 2000-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
 
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; see the file COPYING.LIB.  If
-   not, see <http://www.gnu.org/licenses/>.  */
+   not, see <https://www.gnu.org/licenses/>.  */
 
 #include <assert.h>
 #include <errno.h>
@@ -29,7 +29,7 @@
 #include <sys/syscall.h>
 
 #include "posix-timer.h"
-#include <internaltypes.h>
+#include <timer_routines.h>
 
 #ifndef DELAYTIMER_MAX
 # define DELAYTIMER_MAX INT_MAX
@@ -376,7 +376,7 @@ thread_func (void *arg)
 
          /* This assumes that the elements of the list of one thread
             are all for the same clock.  */
-         clock_gettime (timer->clock, &now);
+         __clock_gettime (timer->clock, &now);
 
          while (1)
            {
@@ -463,10 +463,14 @@ int
 __timer_thread_start (struct thread_node *thread)
 {
   int retval = 1;
+  sigset_t set, oset;
 
   assert (!thread->exists);
   thread->exists = 1;
 
+  sigfillset (&set);
+  pthread_sigmask (SIG_SETMASK, &set, &oset);
+
   if (pthread_create (&thread->id, &thread->attr,
                      (void *(*) (void *)) thread_func, thread) != 0)
     {
@@ -474,6 +478,8 @@ __timer_thread_start (struct thread_node *thread)
       retval = -1;
     }
 
+  pthread_sigmask (SIG_SETMASK, &oset, NULL);
+
   return retval;
 }