Replace ioctl with select to reduce processor usage by lldb-mi on OSX.
authorHafiz Abid Qadeer <hafiz_abid@mentor.com>
Mon, 15 Dec 2014 19:09:40 +0000 (19:09 +0000)
committerHafiz Abid Qadeer <hafiz_abid@mentor.com>
Mon, 15 Dec 2014 19:09:40 +0000 (19:09 +0000)
commitfcbc3cdf3c2cc9593d1ff2ba4823608e51dff74c
tree40e647d3fe67d027b4dd56176cc0d4f059e12885
parentbe7ea19b585dc1b0d4c4358df3ca498ceb65b969
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 <ki.stfu@gmail.com>. A few changes were made by me.

llvm-svn: 224258
lldb/tools/lldb-mi/MICmnStreamStdin.cpp
lldb/tools/lldb-mi/MICmnStreamStdin.h
lldb/tools/lldb-mi/MICmnStreamStdinLinux.cpp
lldb/tools/lldb-mi/MICmnStreamStdinLinux.h
lldb/tools/lldb-mi/MIDriver.cpp