* 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.
This commit is contained in:
Christopher Faylor
2002-12-25 20:33:21 +00:00
parent a8eb76e3e1
commit 088f471c75
3 changed files with 14 additions and 0 deletions

View File

@@ -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);