Index: [7minclude/lldb/Target/Process.h[0m
===================================================================
[31m--- include/lldb/Target/Process.h	(revision 234201)[0m
[32m+++ include/lldb/Target/Process.h	(working copy)[0m
[35m@@ -2732,10 +2732,16 @@[0m
     ///     true if successfully signalled that process started and IOHandler pushes, false
     ///     if it timed out.
     //--------------------------------------------------------------------------------------
 [31m    bool[0m
 [31m    SyncIOHandler (uint64_t timeout_msec);[0m
 [32m    uint32_t[0m
 [32m    GetIOHandlerID () const[0m
 [32m    {[0m
 [32m        return m_iohandler_sync.GetValue();[0m
 [32m    }[0m
 
 [32m    void[0m
 [32m    SyncIOHandler (uint32_t iohandler_id, uint64_t timeout_msec);[0m
 
 [32m
[0m     lldb::StateType
     WaitForStateChangedEvents (const TimeValue *timeout,
                                lldb::EventSP &event_sp,
[35m@@ -3157,7 +3163,7 @@[0m
     std::string                 m_stderr_data;
     Mutex                       m_profile_data_comm_mutex;
     std::vector<std::string>    m_profile_data;
 [31m    Predicate<bool>             m_iohandler_sync;[0m
 [32m    Predicate<uint32_t>         m_iohandler_sync;[0m
     MemoryCache                 m_memory_cache;
     AllocatedMemoryCache        m_allocated_memory_cache;
     bool                        m_should_detach;   /// Should we detach if the process object goes away with an explicit call to Kill or Detach?
Index: [7msource/Commands/CommandObjectProcess.cpp[0m
===================================================================
[31m--- source/Commands/CommandObjectProcess.cpp	(revision 234201)[0m
[32m+++ source/Commands/CommandObjectProcess.cpp	(working copy)[0m
[35m@@ -757,6 +757,8 @@[0m
                 }
             }
 
 [32m            const uint32_t iohandler_id = process->GetIOHandlerID();[0m
 [32m
[0m             StreamString stream;
             Error error;
             if (synchronous_execution)
[35m@@ -769,7 +771,7 @@[0m
                 // There is a race condition where this thread will return up the call stack to the main command
                 // handler and show an (lldb) prompt before HandlePrivateEvent (from PrivateStateThread) has
                 // a chance to call PushProcessIOHandler().
 [31m                process->SyncIOHandler(2000);[0m
 [32m                process->SyncIOHandler(iohandler_id, 2000);[0m
 
                 result.AppendMessageWithFormat ("Process %" PRIu64 " resuming\n", process->GetID());
                 if (synchronous_execution)
Index: [7msource/Commands/CommandObjectThread.cpp[0m
===================================================================
[31m--- source/Commands/CommandObjectThread.cpp	(revision 234201)[0m
[32m+++ source/Commands/CommandObjectThread.cpp	(working copy)[0m
[35m@@ -669,6 +669,8 @@[0m
 
             process->GetThreadList().SetSelectedThreadByID (thread->GetID());
 
 [32m            const uint32_t iohandler_id = process->GetIOHandlerID();[0m
 [32m
[0m             StreamString stream;
             Error error;
             if (synchronous_execution)
[35m@@ -679,7 +681,7 @@[0m
             // There is a race condition where this thread will return up the call stack to the main command handler
             // and show an (lldb) prompt before HandlePrivateEvent (from PrivateStateThread) has
             // a chance to call PushProcessIOHandler().
 [31m            process->SyncIOHandler(2000);[0m
 [32m            process->SyncIOHandler(iohandler_id, 2000);[0m
 
             if (synchronous_execution)
             {
Index: [7msource/Target/Process.cpp[0m
===================================================================
[31m--- source/Target/Process.cpp	(revision 234201)[0m
[32m+++ source/Target/Process.cpp	(working copy)[0m
[35m@@ -740,7 +740,7 @@[0m
     m_stderr_data (),
     m_profile_data_comm_mutex (Mutex::eMutexTypeRecursive),
     m_profile_data (),
 [31m    m_iohandler_sync (false),[0m
 [32m    m_iohandler_sync (0),[0m
     m_memory_cache (*this),
     m_allocated_memory_cache (*this),
     m_should_detach (false),
[35m@@ -949,33 +949,17 @@[0m
     return state;
 }
 
 [31mbool[0m
 [31mProcess::SyncIOHandler (uint64_t timeout_msec)[0m
 [32mvoid[0m
 [32mProcess::SyncIOHandler (uint32_t iohandler_id, uint64_t timeout_msec)[0m
 {
 [31m    bool timed_out = false;[0m
 [31m
[0m     // don't sync (potentially context switch) in case where there is no process IO
     if (m_process_input_reader)
     {
         TimeValue timeout = TimeValue::Now();
         timeout.OffsetWithMicroSeconds(timeout_msec*1000);
 [31m
[0m [31m        m_iohandler_sync.WaitForValueEqualTo(true, &timeout, &timed_out);[0m
 [31m
[0m [31m        Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));[0m
 [31m        if(log)[0m
 [31m        {[0m
 [31m            if(timed_out)[0m
 [31m                log->Printf ("Process::%s pid %" PRIu64 " (timeout=%" PRIu64 "ms): FAIL", __FUNCTION__, GetID (), timeout_msec);[0m
 [31m            else[0m
 [31m                log->Printf ("Process::%s pid %" PRIu64 ": SUCCESS", __FUNCTION__, GetID ());[0m
 [31m        }[0m
 [31m
[0m [31m        // reset sync one-shot so it will be ready for next launch[0m
 [31m        m_iohandler_sync.SetValue(false, eBroadcastNever);[0m
 [32m        uint32_t new_iohandler_id = 0;[0m
 [32m        m_iohandler_sync.WaitForValueNotEqualTo(iohandler_id, new_iohandler_id, &timeout);[0m
     }
 [31m
[0m [31m    return !timed_out;[0m
 }
 
 StateType
[35m@@ -4435,11 +4419,10 @@[0m
             // Or don't push it if we are launching since it will come up stopped.
             if (!GetTarget().GetDebugger().IsForwardingEvents() && new_state != eStateLaunching)
                 PushProcessIOHandler ();
 [31m            m_iohandler_sync.SetValue(true, eBroadcastAlways);[0m
 [32m            m_iohandler_sync.SetValue(m_iohandler_sync.GetValue()+1, eBroadcastAlways);[0m
         }
         else if (StateIsStoppedState(new_state, false))
         {
 [31m            m_iohandler_sync.SetValue(false, eBroadcastNever);[0m
             if (!Process::ProcessEventData::GetRestartedFromEvent(event_sp.get()))
             {
                 // If the lldb_private::Debugger is handling the events, we don't
Index: [7msource/Target/Target.cpp[0m
===================================================================
[31m--- source/Target/Target.cpp	(revision 234201)[0m
[32m+++ source/Target/Target.cpp	(working copy)[0m
[35m@@ -2616,6 +2616,8 @@[0m
             
             if (state == eStateStopped)
             {
 [32m                const uint32_t iohandler_id = m_process_sp->GetIOHandlerID();[0m
 [32m
[0m                 if (!launch_info.GetFlags().Test(eLaunchFlagStopAtEntry))
                 {
                     if (synchronous_execution)
[35m@@ -2640,7 +2642,7 @@[0m
                             // there is a race condition where this thread will return up the call stack to the main command
                             // handler and show an (lldb) prompt before HandlePrivateEvent (from PrivateStateThread) has
                             // a chance to call PushProcessIOHandler()
 [31m                            m_process_sp->SyncIOHandler(2000);[0m
 [32m                            m_process_sp->SyncIOHandler(iohandler_id, 2000);[0m
                         }
                     }
                     if (!error.Success())
[35m@@ -2661,7 +2663,7 @@[0m
                     // there is a race condition where this thread will return up the call stack to the main command
                     // handler and show an (lldb) prompt before HandlePrivateEvent (from PrivateStateThread) has
                     // a chance to call PushProcessIOHandler()
 [31m                    m_process_sp->SyncIOHandler(2000);[0m
 [32m                    m_process_sp->SyncIOHandler(iohandler_id, 2000);[0m
                 }
             }
             else if (state == eStateExited)
