This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: Signal handling tune up.
Christopher Faylor wrote:
>
> >While looking at the code, I got worried by interrupt_setup(). As soon
> >as sigsave.sig = sig; is executed, the sigsave can be picked up by a
> >terminating handler. Thus shouldn't sigsave.sig = sig; be the last
> >statement in interrupt_setup() to avoid a race condition?
>
> Yes, it's a race but I think it's harmless since, AFAICT, the only thing
> affected is errno which wouldn't be handled in a recursive signal call.
> I'll move the setting to the end of interrupt_setup, though.
OK.
There is also the SetEvent (signal_arrived) that must be done before
it's reset in the handler.
Pierre