]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: avoid letting signals go to thread created by timer_create
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Fri, 30 Mar 2018 00:45:01 +0000 (02:45 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 1 Apr 2018 23:32:11 +0000 (01:32 +0200)
* sysdeps/pthread/timer_routines.c (__timer_thread_start): Block all
signals in thread created for runing timers.

ChangeLog
sysdeps/pthread/timer_routines.c

index fff94307cadb26145c10ff35f2e24ad32cda247a..55eec1b939b890baf501965c36bab7988fef9a55 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-04-02  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+       * sysdeps/pthread/timer_routines.c (__timer_thread_start): Block all
+       signals in thread created for runing timers.
+
 2018-04-01  Florian Weimer  <fweimer@redhat.com>
 
        * support/support_format_addrinfo.c (support_format_addrinfo):
index e6e884f53ee21e46df2bc44e92edfd3630c1fa50..25ccfadd7e1ab8ea21bf01208b4773b28dd36355 100644 (file)
@@ -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;
 }