aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-06-08 16:54:41 +0000
committerChristopher Faylor <me@cgf.cx>2013-06-08 16:54:41 +0000
commit62003f180a87d7fd7e15ea3d5744a09c0d39cb04 (patch)
tree7fecdbaccb08e4a1bc9c1000ad26e7df72aa5a1f /winsup
parent1952976a1b807d0d273de902003c79af0eb4f56c (diff)
downloadnewlib-62003f180a87d7fd7e15ea3d5744a09c0d39cb04.zip
newlib-62003f180a87d7fd7e15ea3d5744a09c0d39cb04.tar.gz
newlib-62003f180a87d7fd7e15ea3d5744a09c0d39cb04.tar.bz2
* exceptions.cc (try_to_debug): Don't use yield() when waiting for another
process. (sigpacket::setup_handler): Fix long-standing problem where loop could exit with lock held.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/exceptions.cc8
2 files changed, 13 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a32a28a..ffa1960 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,12 @@
2013-06-08 Christopher Faylor <me.cygwin2013@cgf.cx>
+ * exceptions.cc (try_to_debug): Don't use yield() when waiting for
+ another process.
+ (sigpacket::setup_handler): Fix long-standing problem where loop could
+ exit with lock held.
+
+2013-06-08 Christopher Faylor <me.cygwin2013@cgf.cx>
+
* miscfuncs.cc (yield): Revert (after researching) to calling SleepEx
with 0. We don't want to actually sleep when calling this function.
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index ac13478..46af2ba 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -508,7 +508,7 @@ try_to_debug (bool waitloop)
return dbg;
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
while (!being_debugged ())
- yield ();
+ Sleep (1);
Sleep (2000);
}
@@ -923,7 +923,10 @@ sigpacket::setup_handler (void *handler, struct sigaction& siga, _cygtls *tls)
DWORD res;
HANDLE hth = (HANDLE) *tls;
if (!hth)
- sigproc_printf ("thread handle NULL, not set up yet?");
+ {
+ tls->unlock ();
+ sigproc_printf ("thread handle NULL, not set up yet?");
+ }
else
{
/* Suspend the thread which will receive the signal.
@@ -936,6 +939,7 @@ sigpacket::setup_handler (void *handler, struct sigaction& siga, _cygtls *tls)
/* Just set pending if thread is already suspended */
if (res)
{
+ tls->unlock ();
ResumeThread (hth);
goto out;
}