diff options
author | Christopher Faylor <me@cgf.cx> | 2012-07-30 01:43:29 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-07-30 01:43:29 +0400 |
commit | dd06381996da1d519f76489fe531cb0ed46e3fc6 (patch) | |
tree | 7e4c7c8a2f5c93c06c0e1f310de668d9430393ff /winsup/cygwin/exceptions.cc | |
parent | ab6596266fc616cbe235bb919349f22ff9a75aba (diff) |
* cygtls.cc (_cygtls::reset_signal_arrived): New function.
(set_signal_arrived::~set_signal_arrived): Use reset_signal_arrived to reset
state.
* exceptions.cc (sig_handle_tty_stop): Use WAIT_SIGNALED rather than assume we
know the return from cancelable_wait.
(_cygtls::interrupt_setup): Modify to allow calling when executing in
non-cygwin code via sigdelayed. Always reset signal_arrived.
* gendef: Throughout use start_offset rather than the completely wrong
sizeof__cygtls.
(_sigdelayed): Rewrite to avoid duplication when calling the signal handler.
(sigreturn): Delete.
* gentls_offsets: Define start_offset rather than sizeof__cygtls.
* tlsoffsets.h: Regenerate.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 91517fd58..6c4740059 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -748,7 +748,7 @@ sig_handle_tty_stop (int sig) switch (cancelable_wait (sigCONT, cw_infinite, cw_sig_eintr)) { case WAIT_OBJECT_0: - case WAIT_OBJECT_0 + 1: + case WAIT_SIGNALED: myself->stopsig = SIGCONT; myself->alert_parent (SIGCONT); break; @@ -801,7 +801,7 @@ _cygtls::interrupt_setup (int sig, void *handler, struct sigaction& siga) this->sig = sig; // Should always be last thing set to avoid a race - if (signal_arrived) + if (incyg && signal_arrived) SetEvent (signal_arrived); proc_subproc (PROC_CLEARWAIT, 1); @@ -1259,10 +1259,14 @@ _cygtls::call_signal_handler () while (1) { lock (); - if (sig) + if (!sig) + { + unlock (); + break; + } + + if (incyg) pop (); - else - break; debug_only_printf ("dealing with signal %d", sig); this_sa_flags = sa_flags; @@ -1272,12 +1276,12 @@ _cygtls::call_signal_handler () sigset_t this_oldmask = set_process_mask_delta (); int this_errno = saved_errno; sig = 0; + reset_signal_arrived (); unlock (); // make sure synchronized if (!(this_sa_flags & SA_SIGINFO)) { - void (*sigfunc) (int) = thisfunc; incyg = false; - sigfunc (thissig); + thisfunc (thissig); } else { @@ -1293,7 +1297,6 @@ _cygtls::call_signal_handler () set_errno (this_errno); } - unlock (); return this_sa_flags & SA_RESTART || (this != _main_tls); } |