Make the "synchronous" mode actually work without race conditions.
There were many issues with synchronous mode that we discovered when started to try and add a "batch" mode. There was a race condition where the event handling thread might consume events when in sync mode and other times the Process::WaitForProcessToStop() would consume them. This also led to places where the Process IO handler might or might not get popped when it needed to be. llvm-svn: 220254
This commit is contained in:
@@ -739,18 +739,10 @@ SBProcess::Continue ()
|
||||
{
|
||||
Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
|
||||
|
||||
Error error (process_sp->Resume());
|
||||
if (error.Success())
|
||||
{
|
||||
if (process_sp->GetTarget().GetDebugger().GetAsyncExecution () == false)
|
||||
{
|
||||
if (log)
|
||||
log->Printf ("SBProcess(%p)::Continue () waiting for process to stop...",
|
||||
static_cast<void*>(process_sp.get()));
|
||||
process_sp->WaitForProcessToStop (NULL);
|
||||
}
|
||||
}
|
||||
sb_error.SetError(error);
|
||||
if (process_sp->GetTarget().GetDebugger().GetAsyncExecution ())
|
||||
sb_error.ref() = process_sp->Resume ();
|
||||
else
|
||||
sb_error.ref() = process_sp->ResumeSynchronous (NULL);
|
||||
}
|
||||
else
|
||||
sb_error.SetErrorString ("SBProcess is invalid");
|
||||
|
||||
Reference in New Issue
Block a user