* exceptions.cc (_cygtls::interrupt_now): Avoid nonsensical tests which delay
an interrupt. (setup_handler): Remove unneeded DEBUGGING handling. Ensure that stack is locked when we are about to do push/pop to it. Fix debugging output.
This commit is contained in:
parent
3a7c5515b2
commit
9134e80ac6
|
@ -1,3 +1,10 @@
|
||||||
|
2010-07-18 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
|
* exceptions.cc (_cygtls::interrupt_now): Avoid nonsensical tests which
|
||||||
|
delay an interrupt.
|
||||||
|
(setup_handler): Remove unneeded DEBUGGING handling. Ensure that stack
|
||||||
|
is locked when we are about to do push/pop to it. Fix debugging output.
|
||||||
|
|
||||||
2010-07-18 Christopher Faylor <me+cygwin@cgf.cx>
|
2010-07-18 Christopher Faylor <me+cygwin@cgf.cx>
|
||||||
|
|
||||||
* gendef: Throughout, remove lock from xchgl since it is implied.
|
* gendef: Throughout, remove lock from xchgl since it is implied.
|
||||||
|
|
|
@ -778,7 +778,7 @@ _cygtls::interrupt_now (CONTEXT *cx, int sig, void *handler,
|
||||||
{
|
{
|
||||||
bool interrupted;
|
bool interrupted;
|
||||||
|
|
||||||
if (incyg || spinning || locked () || inside_kernel (cx))
|
if (incyg || inside_kernel (cx))
|
||||||
interrupted = false;
|
interrupted = false;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -861,7 +861,6 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _cygtls *tls)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
tls->unlock ();
|
|
||||||
DWORD res;
|
DWORD res;
|
||||||
HANDLE hth = (HANDLE) *tls;
|
HANDLE hth = (HANDLE) *tls;
|
||||||
|
|
||||||
|
@ -874,14 +873,7 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _cygtls *tls)
|
||||||
If the thread is already suspended (which can occur when a program has called
|
If the thread is already suspended (which can occur when a program has called
|
||||||
SuspendThread on itself) then just queue the signal. */
|
SuspendThread on itself) then just queue the signal. */
|
||||||
|
|
||||||
#ifndef DEBUGGING
|
sigproc_printf ("suspending thread");
|
||||||
sigproc_printf ("suspending mainthread");
|
|
||||||
#else
|
|
||||||
cx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
|
|
||||||
if (!GetThreadContext (hth, &cx))
|
|
||||||
memset (&cx, 0, sizeof cx);
|
|
||||||
sigproc_printf ("suspending mainthread PC %p", cx.Eip);
|
|
||||||
#endif
|
|
||||||
res = SuspendThread (hth);
|
res = SuspendThread (hth);
|
||||||
/* Just set pending if thread is already suspended */
|
/* Just set pending if thread is already suspended */
|
||||||
if (res)
|
if (res)
|
||||||
|
@ -891,10 +883,11 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _cygtls *tls)
|
||||||
}
|
}
|
||||||
cx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
|
cx.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
|
||||||
if (!GetThreadContext (hth, &cx))
|
if (!GetThreadContext (hth, &cx))
|
||||||
system_printf ("couldn't get context of main thread, %E");
|
system_printf ("couldn't get context of thread, %E");
|
||||||
else
|
else
|
||||||
interrupted = tls->interrupt_now (&cx, sig, handler, siga);
|
interrupted = tls->interrupt_now (&cx, sig, handler, siga);
|
||||||
|
|
||||||
|
tls->unlock ();
|
||||||
res = ResumeThread (hth);
|
res = ResumeThread (hth);
|
||||||
if (interrupted)
|
if (interrupted)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue