* 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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user