diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-04-20 09:52:47 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-04-20 09:52:47 +0000 |
commit | 35856696b8d42536052e5c757e3ee2b133261e0f (patch) | |
tree | 744b89ab0453ec725b2f2e82e77c7706d2b2cac8 /lldb/source/Core/Communication.cpp | |
parent | 84adf3ff1579134a4b019a09ba69504d5de1fe05 (diff) | |
download | bcm5719-llvm-35856696b8d42536052e5c757e3ee2b133261e0f.tar.gz bcm5719-llvm-35856696b8d42536052e5c757e3ee2b133261e0f.zip |
Stop read thread of Communication on EOF
Previously the read thread was only stopped if CloseOnEOF was set on the
communication channel. It caused it to spin in case of an EOF because
::select() always reported that we can read from the file descriptor.
This CL change this behavior with stopping the read thread on EOF but do
a disconnect only if CloseOnEOF is enabled.
Differential revision: http://reviews.llvm.org/D9077
llvm-svn: 235291
Diffstat (limited to 'lldb/source/Core/Communication.cpp')
-rw-r--r-- | lldb/source/Core/Communication.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index 6746e59112f..ae579d1b00a 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -184,7 +184,8 @@ Communication::Read (void *dst, size_t dst_len, uint32_t timeout_usec, Connectio if (event_type & eBroadcastBitReadThreadDidExit) { - Disconnect (NULL); + if (GetCloseOnEOF ()) + Disconnect (NULL); break; } } @@ -379,9 +380,8 @@ Communication::ReadThread (lldb::thread_arg_t p) break; case eConnectionStatusEndOfFile: - if (comm->GetCloseOnEOF()) - done = true; - break; + done = true; + break; case eConnectionStatusError: // Check GetError() for details if (error.GetType() == eErrorTypePOSIX && error.GetError() == EIO) { |