Index: include/lldb/Target/Process.h
===================================================================
--- include/lldb/Target/Process.h	(revision 234201)
+++ include/lldb/Target/Process.h	(working copy)
@@ -2732,10 +2732,16 @@
     ///     true if successfully signalled that process started and IOHandler pushes, false
     ///     if it timed out.
     //--------------------------------------------------------------------------------------
-    bool
-    SyncIOHandler (uint64_t timeout_msec);
+    uint32_t
+    GetIOHandlerID () const
+    {
+        return m_iohandler_sync.GetValue();
+    }
 
+    void
+    SyncIOHandler (uint32_t iohandler_id, uint64_t timeout_msec);
 
+
     lldb::StateType
     WaitForStateChangedEvents (const TimeValue *timeout,
                                lldb::EventSP &event_sp,
@@ -3157,7 +3163,7 @@
     std::string                 m_stderr_data;
     Mutex                       m_profile_data_comm_mutex;
     std::vector<std::string>    m_profile_data;
-    Predicate<bool>             m_iohandler_sync;
+    Predicate<uint32_t>         m_iohandler_sync;
     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: source/Commands/CommandObjectProcess.cpp
===================================================================
--- source/Commands/CommandObjectProcess.cpp	(revision 234201)
+++ source/Commands/CommandObjectProcess.cpp	(working copy)
@@ -757,6 +757,8 @@
                 }
             }
 
+            const uint32_t iohandler_id = process->GetIOHandlerID();
+
             StreamString stream;
             Error error;
             if (synchronous_execution)
@@ -769,7 +771,7 @@
                 // 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().
-                process->SyncIOHandler(2000);
+                process->SyncIOHandler(iohandler_id, 2000);
 
                 result.AppendMessageWithFormat ("Process %" PRIu64 " resuming\n", process->GetID());
                 if (synchronous_execution)
Index: source/Commands/CommandObjectThread.cpp
===================================================================
--- source/Commands/CommandObjectThread.cpp	(revision 234201)
+++ source/Commands/CommandObjectThread.cpp	(working copy)
@@ -669,6 +669,8 @@
 
             process->GetThreadList().SetSelectedThreadByID (thread->GetID());
 
+            const uint32_t iohandler_id = process->GetIOHandlerID();
+
             StreamString stream;
             Error error;
             if (synchronous_execution)
@@ -679,7 +681,7 @@
             // 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().
-            process->SyncIOHandler(2000);
+            process->SyncIOHandler(iohandler_id, 2000);
 
             if (synchronous_execution)
             {
Index: source/Target/Process.cpp
===================================================================
--- source/Target/Process.cpp	(revision 234201)
+++ source/Target/Process.cpp	(working copy)
@@ -740,7 +740,7 @@
     m_stderr_data (),
     m_profile_data_comm_mutex (Mutex::eMutexTypeRecursive),
     m_profile_data (),
-    m_iohandler_sync (false),
+    m_iohandler_sync (0),
     m_memory_cache (*this),
     m_allocated_memory_cache (*this),
     m_should_detach (false),
@@ -949,33 +949,17 @@
     return state;
 }
 
-bool
-Process::SyncIOHandler (uint64_t timeout_msec)
+void
+Process::SyncIOHandler (uint32_t iohandler_id, uint64_t timeout_msec)
 {
-    bool timed_out = false;
-
     // 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);
-
-        m_iohandler_sync.WaitForValueEqualTo(true, &timeout, &timed_out);
-
-        Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
-        if(log)
-        {
-            if(timed_out)
-                log->Printf ("Process::%s pid %" PRIu64 " (timeout=%" PRIu64 "ms): FAIL", __FUNCTION__, GetID (), timeout_msec);
-            else
-                log->Printf ("Process::%s pid %" PRIu64 ": SUCCESS", __FUNCTION__, GetID ());
-        }
-
-        // reset sync one-shot so it will be ready for next launch
-        m_iohandler_sync.SetValue(false, eBroadcastNever);
+        uint32_t new_iohandler_id = 0;
+        m_iohandler_sync.WaitForValueNotEqualTo(iohandler_id, new_iohandler_id, &timeout);
     }
-
-    return !timed_out;
 }
 
 StateType
@@ -4435,11 +4419,10 @@
             // Or don't push it if we are launching since it will come up stopped.
             if (!GetTarget().GetDebugger().IsForwardingEvents() && new_state != eStateLaunching)
                 PushProcessIOHandler ();
-            m_iohandler_sync.SetValue(true, eBroadcastAlways);
+            m_iohandler_sync.SetValue(m_iohandler_sync.GetValue()+1, eBroadcastAlways);
         }
         else if (StateIsStoppedState(new_state, false))
         {
-            m_iohandler_sync.SetValue(false, eBroadcastNever);
             if (!Process::ProcessEventData::GetRestartedFromEvent(event_sp.get()))
             {
                 // If the lldb_private::Debugger is handling the events, we don't
Index: source/Target/Target.cpp
===================================================================
--- source/Target/Target.cpp	(revision 234201)
+++ source/Target/Target.cpp	(working copy)
@@ -2616,6 +2616,8 @@
             
             if (state == eStateStopped)
             {
+                const uint32_t iohandler_id = m_process_sp->GetIOHandlerID();
+
                 if (!launch_info.GetFlags().Test(eLaunchFlagStopAtEntry))
                 {
                     if (synchronous_execution)
@@ -2640,7 +2642,7 @@
                             // 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()
-                            m_process_sp->SyncIOHandler(2000);
+                            m_process_sp->SyncIOHandler(iohandler_id, 2000);
                         }
                     }
                     if (!error.Success())
@@ -2661,7 +2663,7 @@
                     // 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()
-                    m_process_sp->SyncIOHandler(2000);
+                    m_process_sp->SyncIOHandler(iohandler_id, 2000);
                 }
             }
             else if (state == eStateExited)
