summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-09-30 23:52:13 +0000
committerChristopher Faylor <me@cgf.cx>2005-09-30 23:52:13 +0000
commitf5cfdc0fa440eb88870963cc9440369203bb0b13 (patch)
tree4bbd831c36a65209c3271ed0daabfc1775cbd0f1 /winsup/cygwin/exceptions.cc
parentfd45a7909b739539a4dd21fa8ce7b284c464124f (diff)
downloadcygnal-f5cfdc0fa440eb88870963cc9440369203bb0b13.tar.gz
cygnal-f5cfdc0fa440eb88870963cc9440369203bb0b13.tar.bz2
cygnal-f5cfdc0fa440eb88870963cc9440369203bb0b13.zip
* dcrt0.cc (do_exit): Don't set ES_SET_MUTO here. Call get_exit_lock()
instead. (get_exit_lock): New function. Grabs the lock and sets initial exit_state. * exceptions.cc (try_to_debug): Use low_priority_sleep. (sigpacket::process): Avoid handler if this is an exec stub. (signal_exit): Use get_exit_lock rather than manipulating the exit_lock critical section directly. * pinfo.cc (pinfo::exit): Ditto. * winsup.h (get_exit_lock): Declare. (exit_lock): Delete declaration.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 6811ecf40..02b2f2b49 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -388,7 +388,7 @@ try_to_debug (bool waitloop)
return dbg;
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_IDLE);
while (!being_debugged ())
- Sleep (0);
+ low_priority_sleep (0);
Sleep (2000);
}
@@ -1041,7 +1041,13 @@ sigpacket::process ()
myself->rusage_self.ru_nsignals++;
bool masked;
- void *handler = (void *) thissig.sa_handler;
+ void *handler;
+ if (!hExeced || (void *) thissig.sa_handler == (void *) SIG_IGN)
+ handler = (void *) thissig.sa_handler;
+ else if (tls)
+ return 1;
+ else
+ handler = NULL;
if (si.si_signo == SIGKILL)
goto exit_sig;
@@ -1175,7 +1181,7 @@ signal_exit (int rc)
TerminateProcess (hExeced, sigExeced = rc);
}
- EnterCriticalSection (&exit_lock);
+ get_exit_lock ();
if (hExeced || exit_state)
myself.exit (rc);