[PATCH 2/3] Cygwin: signal: Do not wait for sendsig for non-cygwin process

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Mar 11 15:11:56 GMT 2026


On Mar 10 17:50, Takashi Yano wrote:
> Waiting for `sendsig` to be non-zero for non-cygwin process is
> pointless, because it never becomes non-zero (see spawn.cc).
> Do not wait `sendsig` for a non-cygwin process.
> 
> Fixes: d584454c8231 ("* sigproc.cc (sig_send): Wait for dwProcessId to be non-zero as well as sendsig.")
> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
> Reviewed-by:
> ---
>  winsup/cygwin/sigproc.cc | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
> index 0fd7ed3ba..4ff05967b 100644
> --- a/winsup/cygwin/sigproc.cc
> +++ b/winsup/cygwin/sigproc.cc
> @@ -646,9 +646,12 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
>      {
>        HANDLE dupsig;
>        DWORD dwProcessId;
> -      DWORD t0 = GetTickCount ();
> -      while (GetTickCount () - t0 < 100 && !p->sendsig)
> -	yield ();
> +      if (!ISSTATE (p, PID_NOTCYGWIN))
> +	{
> +	  DWORD t0 = GetTickCount ();
> +	  while (GetTickCount () - t0 < 100 && !p->sendsig)
> +	    yield ();
> +	}
>        if (p->sendsig)
>  	{
>  	  dupsig = p->sendsig;
> -- 
> 2.51.0

LGTM


Thanks,
COrinna


More information about the Cygwin-patches mailing list