From a3b89e272c6f99d878d674a3346808e06fa75e28 Mon Sep 17 00:00:00 2001 From: Todd Fiala Date: Tue, 12 Aug 2014 14:33:19 +0000 Subject: Fix iohandler prompt race condition. This issue caused the lldb prompt to not show up in certain cases, very noticeable on Linux systems. See details on this review: http://reviews.llvm.org/D4863 And on this lldb-commits thread: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140811/012306.html Change by Shawn Best. (Much useful help and testing by the rest of the community, thanks all!) llvm-svn: 215446 --- lldb/source/Commands/CommandObjectThread.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lldb/source/Commands/CommandObjectThread.cpp') diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index c58e9e8..e7a8652 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -624,7 +624,11 @@ protected: process->GetThreadList().SetSelectedThreadByID (thread->GetID()); process->Resume (); - + + // 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); if (synchronous_execution) { -- cgit v1.1