From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1486 invoked from network); 18 Dec 2006 16:37:35 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.7 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Dec 2006 16:37:35 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 92450 invoked from network); 18 Dec 2006 16:37:29 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Dec 2006 16:37:29 -0000 Received: (qmail 17855 invoked by alias); 18 Dec 2006 16:37:26 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 23068 Received: (qmail 17846 invoked from network); 18 Dec 2006 16:37:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Dec 2006 16:37:25 -0000 Received: (qmail 92109 invoked from network); 18 Dec 2006 16:37:25 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 18 Dec 2006 16:37:21 -0000 Received: from torch.brasslantern.com ([71.116.86.88]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JAH00047A66V0OB@vms046.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 18 Dec 2006 10:37:19 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id kBIGbHqw003871 for ; Mon, 18 Dec 2006 08:37:18 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id kBIGbHUc003870 for zsh-workers@sunsite.dk; Mon, 18 Dec 2006 08:37:17 -0800 Date: Mon, 18 Dec 2006 08:37:17 -0800 From: Bart Schaefer Subject: Re: Is wait not interruptable? In-reply-to: <20061218161229.7bbec427.pws@csr.com> To: Zsh hackers list Message-id: <061218083717.ZM3869@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <200612171600.kBHG0IXv005533@pwslaptop.csr.com> <061217095424.ZM2103@torch.brasslantern.com> <20061218113953.c19237da.pws@csr.com> <20061218161229.7bbec427.pws@csr.com> Comments: In reply to Peter Stephenson "Re: Is wait not interruptable?" (Dec 18, 4:12pm) On Dec 18, 4:12pm, Peter Stephenson wrote: } } As I noted in a comment, there's presumably a race when queuing traps since } the signal may already have been delivered by the time we start the trap } queuing. That's not new (we only queue traps at roughly the point where we } previously blocked signals). I could move the new queue_traps() before } dont_queue_signals() in the two applicable functions: then traps would be } queued when the previously blocked signals arrive. As long as it's "safe" (in terms of shell function re-entrancy) and not semantically incorrect for traps to be executed at that point, I think what you have is fine. Note that the important thing through this whole section is that last_signal is sane, so that we don't end up waiting for the wrong child if both a SIGCHLD and some other signal arrive during the signal_suspend(). (I may be missing a detail that makes that comment irrelevant.) } One slight difference is that in zwaitjob() we'll delay traps to wait } for the entire foreground job, not just the first process to exit. Is that affected by TRAPS_ASYNC?