Skip to content

Commit

Permalink
Cygwin: signal: Drop unnecessary queue flush
Browse files Browse the repository at this point in the history
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: 5e31c80 ("(pending_signals::pending): Force an additional loop through wait_sig by setting retry whenever this function is called.")
Reported-by: Christian Franke <[email protected]>
Reviewed-by: Corinna Vinschen <[email protected]>
Signed-off-by: Takashi Yano <[email protected]>
  • Loading branch information
tyan0 committed Nov 28, 2024
1 parent e10f822 commit 57ce5f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion winsup/cygwin/sigproc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 57ce5f1

Please sign in to comment.