Cygwin: signal: Drop unnecessary queue flush

Previously, the retry flag was always set when pending_signal::pending()
was called. However, if the queue is empty sig thread tries to flush
the queue even though it is not necessary. With this patch, the retry
flag is set only if the queue is not empty.

Addresses: https://cygwin.com/pipermail/cygwin/2024-November/256744.html
Fixes: 5e31c80e4e ("(pending_signals::pending): Force an additional loop through wait_sig by setting retry whenever this function is called.")
Reported-by: Christian Franke <Christian.Franke@t-online.de>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
This commit is contained in:
Takashi Yano 2024-11-25 20:55:44 +09:00
parent e10f822a2b
commit 57ce5f1e0b
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ class pending_signals
public:
void add (sigpacket&);
bool pending () {retry = true; return !!start.next;}
bool pending () {retry = !!start.next; return retry;}
void clear (int sig) {sigs[sig].si.si_signo = 0;}
void clear (_cygtls *tls);
friend void sig_dispatch_pending (bool);