* sigproc.cc (pending_signals::pending): Define new function.

(sig_dispatch_pending): Avoid calling sig_send if there are no pending signals.
This commit is contained in:
Christopher Faylor 2011-08-01 00:02:04 +00:00
parent c114604529
commit dc3dc49831
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2011-07-31 Christopher Faylor <me.cygwin2011@cgf.cx>
* sigproc.cc (pending_signals::pending): Define new function.
(sig_dispatch_pending): Avoid calling sig_send if there are no pending
signals.
2011-07-31 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (class fhandler_dev_mem): Remove dup method declaration.

View File

@ -88,6 +88,7 @@ public:
void reset () {curr = &start; prev = &start;}
void add (sigpacket&);
void del ();
bool pending () const {return !!start.next;}
sigpacket *next ();
sigpacket *save () const {return curr;}
void restore (sigpacket *saved) {curr = saved;}
@ -431,7 +432,13 @@ sig_dispatch_pending (bool fast)
return;
}
sig_send (myself, fast ? __SIGFLUSHFAST : __SIGFLUSH);
/* Non-atomically test for any signals pending and wake up wait_sig if any are
found. It's ok if there's a race here since the next call to this function
should catch it.
FIXME: Eventually, wait_sig should wake up on its own to deal with pending
signals. */
if (sigq.pending ())
sig_send (myself, fast ? __SIGFLUSHFAST : __SIGFLUSH);
}
void __stdcall