summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/dcrt0.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-12-25 20:33:21 +0000
committerChristopher Faylor <me@cgf.cx>2002-12-25 20:33:21 +0000
commit088f471c7534c4bd1a363a87463a2e2adf05297e (patch)
tree4a4e83e1dae8b5af79f6f39b2d638d1b8c19a838 /winsup/cygwin/dcrt0.cc
parenta8eb76e3e157b0531d82ed1b0f4dc57de235c275 (diff)
downloadcygnal-088f471c7534c4bd1a363a87463a2e2adf05297e.tar.gz
cygnal-088f471c7534c4bd1a363a87463a2e2adf05297e.tar.bz2
cygnal-088f471c7534c4bd1a363a87463a2e2adf05297e.zip
* exceptions.cc (events_init): Initialize critical section to control exiting
via signal. (signal_exit): Enter critical section early to avoid exit races with main thread. * dcrt0.cc (do_exit): Use exit_lock critical section to avoid races.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r--winsup/cygwin/dcrt0.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index f12654d26..da39f07a1 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -967,10 +967,12 @@ enum exit_states
};
exit_states NO_COPY exit_state;
+extern CRITICAL_SECTION exit_lock;
extern "C" void __stdcall
do_exit (int status)
{
+ EnterCriticalSection (&exit_lock);
UINT n = (UINT) status;
syscall_printf ("do_exit (%d)", n);