summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygwait.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-04-09 01:01:19 +0000
committerChristopher Faylor <me@cgf.cx>2013-04-09 01:01:19 +0000
commit9d2155089e8709977ef012cfdfd88d511b92d154 (patch)
treeb2d6845c34da33952996e16a1e637f61268ae351 /winsup/cygwin/cygwait.cc
parent037ad80a525e5be3088bcb3b34546498695e746f (diff)
downloadcygnal-9d2155089e8709977ef012cfdfd88d511b92d154.tar.gz
cygnal-9d2155089e8709977ef012cfdfd88d511b92d154.tar.bz2
cygnal-9d2155089e8709977ef012cfdfd88d511b92d154.zip
* cygtls.h (_cygtls::reset_signal_arrived): Actually reset the signal_arrived
event. (_cygtls::handle_SIGCONT): Declare ew function. * cygwait.cc (is_cw_sig_handle): Delete. (is_cw_sig_cont): New convenience define. (cygwait): Clear signal if is_cw_sig_cont and we got a SIGCONT. * cygwait.h (cw_wait_mask): Add cw_sig_cont. * exceptions.cc (sig_handle_tty_stop): Tighten "incyg" region. Use cw_sig_cont param for cygwait. Don't zero signal here outside of lock. (sigpacket::setup_handler): Don't check for in_forkee since we will now never get here in that state. (_cygtls::handle_SIGCONT): Define new function. (sigpacket::process): Call handle_SIGCONT early to deal with SIGCONT. Nuke continue_now handling. Allow SIGKILL to kill a suspended process. Delete a couple of now-unneeded labels. (_cygtls::call_signal_handler): Reorganize setting of incyg within lock. * sigproc.cc (pending_signals): Simplify. (pending_signals::clear): New method. (_cygtls::remove_wq): Reorganize to always close wq.thread_ev if it exists to avoid handle leaks. (sig_clear): Simplify by just calling sigq.clear(). (sig_dispatch_pending): Always call sigq.pending even in signal thread to force another loop in wait_sig. (sig_send): Remove a "goto out" just before out: label. (pending_signals::add): Simplify. (pending_signals::del): Delete. (pending_signals::next): Delete. (wait_sig): Define variable q to be the start of the signal queue. Just iterate through sigq queue, deleting processed or zeroed signals. Only set clearwait when the current signal is SIGCHLD. * sigproc.h: Add a comment about an unused enum.
Diffstat (limited to 'winsup/cygwin/cygwait.cc')
-rw-r--r--winsup/cygwin/cygwait.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/winsup/cygwin/cygwait.cc b/winsup/cygwin/cygwait.cc
index b0476660c..fcf31b39b 100644
--- a/winsup/cygwin/cygwait.cc
+++ b/winsup/cygwin/cygwait.cc
@@ -1,6 +1,6 @@
/* cygwait.h
- Copyright 2011, 2012 Red Hat, Inc.
+ Copyright 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -17,9 +17,9 @@
#define is_cw_cancel_self (mask & cw_cancel_self)
#define is_cw_sig (mask & cw_sig)
#define is_cw_sig_eintr (mask & cw_sig_eintr)
-#define is_cw_sig_return (mask & cw_sig_return)
+#define is_cw_sig_cont (mask & cw_sig_cont)
-#define is_cw_sig_handle (mask & (is_cw_sig | is_cw_sig_eintr))
+#define is_cw_sig_handle (mask & (cw_sig | cw_sig_eintr | cw_sig_cont))
LARGE_INTEGER cw_nowait_storage;
@@ -83,10 +83,12 @@ cygwait (HANDLE object, PLARGE_INTEGER timeout, unsigned mask)
{
_my_tls.lock ();
int sig = _my_tls.sig;
+ if (is_cw_sig_cont && sig == SIGCONT)
+ _my_tls.sig = 0;
_my_tls.unlock ();
if (!sig)
continue;
- if (is_cw_sig_eintr)
+ if (is_cw_sig_eintr || (is_cw_sig_cont && sig == SIGCONT))
res = WAIT_SIGNALED; /* caller will deal with signals */
else if (_my_tls.call_signal_handler ())
continue;