Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-07-06 22:14:22 +0400
committerChristopher Faylor <me@cgf.cx>2011-07-06 22:14:22 +0400
commit51b5e9211d090c0a7a082704988d45dc4a244e48 (patch)
treeb7d30d6910f60b4f5f48b018955a4c89c103968f /winsup/cygwin/exceptions.cc
parentd1204b6378d4a0aa5b5fcce0eff74b716408796c (diff)
* exceptions.cc (_cygtls::interrupt_now): Don't check for spinning here.
(setup_handler): Check for spinning here, assuming that it is transitory and should not affect the retry loop.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 638c6e3b8..9db7f4131 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -777,9 +777,8 @@ _cygtls::interrupt_now (CONTEXT *cx, int sig, void *handler,
/* Delay the interrupt if we are
1) somehow inside the DLL
- 2) in _sigfe (spinning is true) and about to enter cygwin DLL
- 3) in a Windows DLL. */
- if (incyg || spinning || inside_kernel (cx))
+ 2) in a Windows DLL. */
+ if (incyg ||inside_kernel (cx))
interrupted = false;
else
{
@@ -883,8 +882,15 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _cygtls *tls)
cx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
if (!GetThreadContext (hth, &cx))
system_printf ("couldn't get context of thread, %E");
- else
+ else if (!tls->spinning)
interrupted = tls->interrupt_now (&cx, sig, handler, siga);
+ else
+ {
+ /* We should be out of this state very soon so force a retry
+ without incrementing loop counter. */
+ i--;
+ interrupted = false;
+ }
tls->unlock ();
res = ResumeThread (hth);