bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wait unblocks before signals processed


From: Dan Douglas
Subject: Re: wait unblocks before signals processed
Date: Mon, 05 Nov 2012 20:28:23 -0600
User-agent: KMail/4.8.3 (Linux/3.4.6-pf+; KDE/4.8.3; x86_64; ; )

On Monday, November 05, 2012 05:52:41 PM Elliott Forney wrote:
> OK, I see in POSIX mode that a trap on SIGCHLD will cause wait to
> unblock.  We are still maintaining a counter of running jobs though so
> it seems to me that there could race condition in the following line
> 
> trap '((j--))' CHLD
> 
> if two processes quit in rapid succession and one trap gets preempted
> in the middle of ((j--)) then the count may be off.  Is this possible?
> 

I believe that Bash guarantees the trap will run once for every child that 
exits, so it shoud be impossible for the count to become off. See: 
https://lists.gnu.org/archive/html/bug-bash/2012-05/msg00055.html

I think you might be experiencing other known bugs. Chet pushed several 
wait/job related commits within the last few weeks. I haven't tested these 
yet. http://git.savannah.gnu.org/cgit/bash.git/tree/CWRU/CWRU.chlog?h=devel
-- 
Dan Douglas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]