This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: Signal handling tune up.
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-patches at cygwin dot com
- Date: Mon, 18 Aug 2003 21:58:17 -0400
- Subject: Re: Signal handling tune up.
- References: <3.0.5.32.20030818201736.0080e4e0@mail.attbi.com>
- Reply-to: cygwin-patches at cygwin dot com
On Mon, Aug 18, 2003 at 08:17:36PM -0400, Pierre A. Humblet wrote:
>*********************************************************************
>2)
> movl $0,%0 # zero the signal number as a \n\
> # flag to the signal handler thread\n\
> # that it is ok to set up sigsave\n\
> \n\
> call _set_process_mask@4
>There is a race where the sigthread can start a handler for a signal that
>should be blocked.
>Simply interchanging the order still allows the sigthread to try to launch
>a handler (before the mask is set), discovers that sigsave is busy and takes
>cumbersome actions (e.g. Sleep).
>The patch moves set_process_mask all the way up to interrupt_setup(), so
>it is set in the sigthread itself.
I only applied the reversal of the movl with the call above since I'm
not convinced that moving the set_process_mask into interrupt_setup
doesn't introduce a race. It seems like your code could be setting the
signal mask in interrupt_setup while it is also being restured in
sigreturn. That would end up with the signal mask being indeterminate.
cgf