* 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.
This commit is contained in:
Christopher Faylor 2011-07-06 18:14:22 +00:00
parent d1204b6378
commit 51b5e9211d
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2011-07-06 Christopher Faylor <me.cygwin2011@cgf.cx>
* 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.
2011-07-06 Christopher Faylor <me.cygwin2011@cgf.cx>
* exceptions.cc (CALL_HANDLER_RETRY_INNER): Rename to reflect different

View File

@ -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);