From fcbc3cdf3c2cc9593d1ff2ba4823608e51dff74c Mon Sep 17 00:00:00 2001 From: Hafiz Abid Qadeer Date: Mon, 15 Dec 2014 19:09:40 +0000 Subject: Replace ioctl with select to reduce processor usage by lldb-mi on OSX. This saga started with a hang on OSX. 2 solutions were proposed. 1) 'select' based solution works ok on OSX but slows down test completion time on Linux many times. 2) 'ioctl' base solution also works but it causes heavy processor usage on OSX as reported by Ilia K. But as the original hang did not occur on Linux so this commit re-introduces the 'select' in conditional code so that it only runs for OSX. There is no need for this 'fix' to run on Linux. Initial patch by Ilia K . A few changes were made by me. llvm-svn: 224258 --- lldb/tools/lldb-mi/MICmnStreamStdin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lldb/tools/lldb-mi/MICmnStreamStdin.cpp') diff --git a/lldb/tools/lldb-mi/MICmnStreamStdin.cpp b/lldb/tools/lldb-mi/MICmnStreamStdin.cpp index 8dccf16fca2..2d54921d323 100644 --- a/lldb/tools/lldb-mi/MICmnStreamStdin.cpp +++ b/lldb/tools/lldb-mi/MICmnStreamStdin.cpp @@ -435,3 +435,15 @@ CMICmnStreamStdin::SetOSStdinHandler(IOSStdinHandler &vrHandler) return MIstatus::success; } +//++ ------------------------------------------------------------------------------------ +// Details: Do some actions before exiting. +// Type: Method. +// Args: None. +// Return: None. +// Throws: None. +//-- +void +CMICmnStreamStdin::OnExitHandler(void) +{ + m_pStdinReadHandler->InterruptReadLine(); +} -- cgit v1.2.3