summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Communication.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2014-09-23 18:32:09 +0000
committerZachary Turner <zturner@google.com>2014-09-23 18:32:09 +0000
commitacee96ae5290a965e20f1cb938002d9fd4012075 (patch)
tree090ef226cafe984b57d38731f777c760cacc8fde /lldb/source/Core/Communication.cpp
parent4364fef82f06ebffd6dda0802a0b22126ae52c77 (diff)
downloadbcm5719-llvm-acee96ae5290a965e20f1cb938002d9fd4012075.tar.gz
bcm5719-llvm-acee96ae5290a965e20f1cb938002d9fd4012075.zip
Fix up the HostThread interface, making the interface simpler.
Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D5417 llvm-svn: 218325
Diffstat (limited to 'lldb/source/Core/Communication.cpp')
-rw-r--r--lldb/source/Core/Communication.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp
index 4f8628a1f37..ea84843fe0b 100644
--- a/lldb/source/Core/Communication.cpp
+++ b/lldb/source/Core/Communication.cpp
@@ -233,7 +233,7 @@ Communication::StartReadThread (Error *error_ptr)
if (error_ptr)
error_ptr->Clear();
- if (m_read_thread.GetState() == eThreadStateRunning)
+ if (m_read_thread.IsJoinable())
return true;
lldb_private::LogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION,
@@ -245,7 +245,7 @@ Communication::StartReadThread (Error *error_ptr)
m_read_thread_enabled = true;
m_read_thread = ThreadLauncher::LaunchThread(thread_name, Communication::ReadThread, this, error_ptr);
- if (m_read_thread.GetState() != eThreadStateRunning)
+ if (!m_read_thread.IsJoinable())
m_read_thread_enabled = false;
return m_read_thread_enabled;
}
@@ -253,7 +253,7 @@ Communication::StartReadThread (Error *error_ptr)
bool
Communication::StopReadThread (Error *error_ptr)
{
- if (m_read_thread.GetState() != eThreadStateRunning)
+ if (!m_read_thread.IsJoinable())
return true;
lldb_private::LogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION,
@@ -266,18 +266,16 @@ Communication::StopReadThread (Error *error_ptr)
// error = m_read_thread.Cancel();
Error error = m_read_thread.Join(nullptr);
- m_read_thread.Reset();
return error.Success();
}
bool
Communication::JoinReadThread (Error *error_ptr)
{
- if (m_read_thread.GetState() != eThreadStateRunning)
+ if (!m_read_thread.IsJoinable())
return true;
Error error = m_read_thread.Join(nullptr);
- m_read_thread.Reset();
return error.Success();
}
OpenPOWER on IntegriCloud