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: 893076 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-91300-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="qJCpkZ+j"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40C2zt3wlrz9ry1 for ; Fri, 30 Mar 2018 11:48:41 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=Cf4k7RPmtHnQQggkvT9y1MkFPqoOJ/wgSnx6boH4AHWIlRk48yWBs eh19zj72xa08/TF/QkmkvIrQsvJg9xbIwnTMZ/eMQ98G020haF904uKxphG+cMhU elfSBAFYurwNdVpnq4TxJ72/934ncRKQD4EM5NmJbXPntT9zfdYXgo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=3eBQufbEWULVDmB6BUM2bYeAN3g=; b=qJCpkZ+jjMvJu4i0VMH5Kxbu/A/9 NKC8yBG9t2QLuO3OqOIkY2/iI6eWXEVUvARly7SQasv27VRpcGqpRxt7teoiOr3q yag7pLfJo3YvkyzcG21VW8q47dHBfgMCpcKhQPrx+qVLBlZIKxSIuzqot3yDRj3o 5J63fXF4OwVwEsQ= 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; }