* sigproc.cc (wait_sig): Reorganize exit case so that ExitProcess is always
called, since that is the intent of sending a __SIGEXIT. Wait forever for main thread to go away since, presumably, the main thread told us it was going away.
This commit is contained in:
parent
c4ec3e76b9
commit
a3a9aac72d
@ -1,3 +1,10 @@
|
|||||||
|
2005-09-15 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* sigproc.cc (wait_sig): Reorganize exit case so that ExitProcess is
|
||||||
|
always called, since that is the intent of sending a __SIGEXIT. Wait
|
||||||
|
forever for main thread to go away since, presumably, the main thread
|
||||||
|
told us it was going away.
|
||||||
|
|
||||||
2005-09-14 Christopher Faylor <cgf@timesys.com>
|
2005-09-14 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
* spawn.cc (av::fixup): Avoid breaking out of the wrong "loop".
|
* spawn.cc (av::fixup): Avoid breaking out of the wrong "loop".
|
||||||
|
@ -1125,19 +1125,27 @@ wait_sig (VOID *self)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
my_sendsig = NULL;
|
HANDLE h = hMainThread;
|
||||||
DWORD res = WaitForSingleObject (hMainThread, 10000);
|
my_sendsig = hMainThread = NULL;
|
||||||
|
DWORD res = h ? WAIT_OBJECT_0 : WaitForSingleObject (h, INFINITE);
|
||||||
|
|
||||||
if (res != WAIT_OBJECT_0)
|
|
||||||
sigproc_printf ("wait for main thread returned %d", res);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DWORD exitcode = 1;
|
DWORD exitcode = 1;
|
||||||
|
|
||||||
myself.release ();
|
myself.release ();
|
||||||
sigproc_printf ("calling ExitProcess, exitcode %p", exitcode);
|
if (res == WAIT_OBJECT_0)
|
||||||
GetExitCodeThread (hMainThread, &exitcode);
|
{
|
||||||
ExitProcess (exitcode);
|
GetExitCodeThread (h, &exitcode);
|
||||||
|
#ifdef DEBUGGING
|
||||||
|
hMainThread = INVALID_HANDLE_VALUE;
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
#ifdef DEBUGGING
|
||||||
|
console_printf ("wait for main thread %p returned %d", h, res);
|
||||||
|
#else
|
||||||
|
debug_printf ("wait for main thread %p returned %d", h, res);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
sigproc_printf ("exiting thread");
|
|
||||||
ExitThread (0);
|
sigproc_printf ("calling ExitProcess, exitcode %p", exitcode);
|
||||||
|
ExitProcess (exitcode);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user