Add a 10 second timeout to ensure that we don't lock up if we never get to the

process entry point.

llvm-svn: 133598
This commit is contained in:
Greg Clayton 2011-06-22 01:42:17 +00:00
parent 1da6f9d7f1
commit 1a38ea763a
1 changed files with 12 additions and 2 deletions

View File

@ -2060,9 +2060,19 @@ Process::Launch
else
{
EventSP event_sp;
StateType state = WaitForProcessStopPrivate(NULL, event_sp);
TimeValue timeout_time;
timeout_time = TimeValue::Now();
timeout_time.OffsetWithSeconds(10);
StateType state = WaitForProcessStopPrivate(&timeout_time, event_sp);
if (state == eStateStopped || state == eStateCrashed)
if (state == eStateInvalid || event_sp.get() == NULL)
{
// We were able to launch the process, but we failed to
// catch the initial stop.
SetExitStatus (0, "failed to catch stop after launch");
Destroy();
}
else if (state == eStateStopped || state == eStateCrashed)
{
DidLaunch ();