From patchwork Fri Mar 30 00:48:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 26512 Received: (qmail 116356 invoked by alias); 30 Mar 2018 00:48:35 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 116225 invoked by uid 89); 30 Mar 2018 00:48:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd, commited] hurd: avoid letting signals go to thread created by timer_create Date: Fri, 30 Mar 2018 02:48:01 +0200 Message-Id: <20180330004801.30963-1-samuel.thibault@ens-lyon.org> * sysdeps/pthread/timer_routines.c (__timer_thread_start): Block all signals in thread created for runing timers. --- ChangeLog | 5 +++++ sysdeps/pthread/timer_routines.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1f9842518a..5bee19c60f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-03-30 Samuel Thibault + + * sysdeps/pthread/timer_routines.c (__timer_thread_start): Block all + signals in thread created for runing timers. + 2018-03-29 Florian Weimer * sysdeps/unix/sysv/linux/i386/tst-bz21269.c (do_test): Also 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; }