diff options
author | Christopher Faylor <me@cgf.cx> | 2010-07-19 00:13:26 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-07-19 00:13:26 +0400 |
commit | 9134e80ac6849f83c77c420f02e5504649d3fcf3 (patch) | |
tree | ed875b1de14ecadda10461e266694867dbea7040 /winsup/cygwin | |
parent | 3a7c5515b21bfa9657253df1e73d39100fcd0658 (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/exceptions.cc | 15 |
2 files changed, 11 insertions, 11 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3e26106dc..e98afd8fd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 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> + * gendef: Throughout, remove lock from xchgl since it is implied. (__ZN7_cygtls3popEv): Avoid potential (but probably nonexistent) race when clearing element after pop. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index ffc2ff1cb..50ee79512 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -778,7 +778,7 @@ _cygtls::interrupt_now (CONTEXT *cx, int sig, void *handler, { bool interrupted; - if (incyg || spinning || locked () || inside_kernel (cx)) + if (incyg || inside_kernel (cx)) interrupted = false; else { @@ -861,7 +861,6 @@ setup_handler (int sig, void *handler, struct sigaction& siga, _cygtls *tls) break; } - tls->unlock (); DWORD res; 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 SuspendThread on itself) then just queue the signal. */ -#ifndef DEBUGGING - 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 + sigproc_printf ("suspending thread"); res = SuspendThread (hth); /* Just set pending if thread is already suspended */ if (res) @@ -891,10 +883,11 @@ 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 main thread, %E"); + system_printf ("couldn't get context of thread, %E"); else interrupted = tls->interrupt_now (&cx, sig, handler, siga); + tls->unlock (); res = ResumeThread (hth); if (interrupted) break; |