summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-09-14 14:00:07 +0000
committerChristopher Faylor <me@cgf.cx>2005-09-14 14:00:07 +0000
commita611ae50d5c1106988df7ec8b053efc332e35ae3 (patch)
tree0057df8d08fd439ed9bcfb06bd07538c6f2f9d6e /winsup/cygwin/dcrt0.cc
parent67483cb2cdee37aa435fd108cea5310a873925a3 (diff)
downloadcygnal-a611ae50d5c1106988df7ec8b053efc332e35ae3.tar.gz
cygnal-a611ae50d5c1106988df7ec8b053efc332e35ae3.tar.bz2
cygnal-a611ae50d5c1106988df7ec8b053efc332e35ae3.zip
* exceptions.cc (sigtid): Remove declaration.
(handle_exceptions): Use _sig_tls rather than sigtid to determine if this is the signal thread. (set_signal_mask): Ditto for conditionalized CGF code. * pinfo.cc (pinfo::exit): Exit the thread if we forcefully terminated the main thread * sigproc.cc (sigtid): Delete. (_sig_tls): Define. (sig_clear): Use _sig_tls rather than sigtid to determine if this is the signal thread. (sig_dispatch_pending): Ditto. (wait_sig): Set _sig_tls here. * dcrt0.cc (do_exit): Move sigproc_terminate call later since signal handling was still needed for subsequent stuff. Call sigproc_terminate with new exit_state value. * pinfo.cc (pinfo::exit): Call sigproc_terminate with new exit_state value. * sigproc.cc (proc_terminate): Remove unnecessary (void) parameter. (sigproc_terminate): Ditto. Add new argument to accept exit state to be set. (wait_sig): Reorganize __SIGEXIT handling. Add more debugging output. * winsup.h (sigproc_terminate): Declare with new exit_state argument. (exit_states): Reorganize to reflect new exit ordering of sigproc_terminate.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index b7207667f..f293901b8 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -1056,17 +1056,7 @@ do_exit (int status)
close_all_files ();
}
- if (exit_state < ES_SIGPROCTERMINATE)
- sigproc_terminate (); // sets exit_state directly
-
myself->stopsig = 0;
- if (exit_state < ES_TITLE)
- {
- exit_state = ES_TITLE;
- /* restore console title */
- if (old_title && display_title)
- set_console_title (old_title);
- }
if (exit_state < ES_HUP_PGRP)
{
@@ -1101,6 +1091,17 @@ do_exit (int status)
}
+ if (exit_state < ES_SIGPROCTERMINATE)
+ sigproc_terminate (ES_SIGPROCTERMINATE); // sets exit_state directly
+
+ if (exit_state < ES_TITLE)
+ {
+ exit_state = ES_TITLE;
+ /* restore console title */
+ if (old_title && display_title)
+ set_console_title (old_title);
+ }
+
if (exit_state < ES_TTY_TERMINATE)
{
exit_state = ES_TTY_TERMINATE;
@@ -1165,9 +1166,6 @@ __api_fatal (const char *fmt, ...)
WriteFile (h, buf, len, &done, 0);
}
- /* We are going down without mercy. Make sure we reset
- our process_state. */
- sigproc_terminate ();
#ifdef DEBUGGING
try_to_debug ();
#endif