about summary refs log tree commit diff
path: root/sysdeps/pthread
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-30 02:45:01 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-04-02 01:32:11 +0200
commit03e2aa50fd512449025bba8c244d16338d8526a4 (patch)
tree2ec201a2558be4d9a1da0647e3e14a4390aaf52a /sysdeps/pthread
parent1aa52ced5d6f090b6ee034626189ee03c1b2f582 (diff)
downloadglibc-03e2aa50fd512449025bba8c244d16338d8526a4.tar.gz
glibc-03e2aa50fd512449025bba8c244d16338d8526a4.tar.xz
glibc-03e2aa50fd512449025bba8c244d16338d8526a4.zip
hurd: avoid letting signals go to thread created by timer_create
* sysdeps/pthread/timer_routines.c (__timer_thread_start): Block all
signals in thread created for runing timers.
Diffstat (limited to 'sysdeps/pthread')
-rw-r--r--sysdeps/pthread/timer_routines.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/pthread/timer_routines.c b/sysdeps/pthread/timer_routines.c
index e6e884f53e..25ccfadd7e 100644
--- a/sysdeps/pthread/timer_routines.c
+++ b/sysdeps/pthread/timer_routines.c
@@ -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;
 }