diff --git a/lldb/include/lldb/Core/Communication.h b/lldb/include/lldb/Core/Communication.h index 98d4dfd011b8..2dde55044171 100644 --- a/lldb/include/lldb/Core/Communication.h +++ b/lldb/include/lldb/Core/Communication.h @@ -286,6 +286,8 @@ public: virtual bool StopReadThread (Error *error_ptr = NULL); + virtual bool + JoinReadThread (Error *error_ptr = NULL); //------------------------------------------------------------------ /// Checks if there is a currently running read thread. /// diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index 6ea7a11426be..f05ce320b5be 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -269,6 +269,16 @@ Communication::StopReadThread (Error *error_ptr) return status; } +bool +Communication::JoinReadThread (Error *error_ptr) +{ + if (!IS_VALID_LLDB_HOST_THREAD(m_read_thread)) + return true; + + bool success = Host::ThreadJoin (m_read_thread, NULL, error_ptr); + m_read_thread = LLDB_INVALID_HOST_THREAD; + return success; +} size_t Communication::GetCachedBytes (void *dst, size_t dst_len)