summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process/Linux')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp14
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp14
2 files changed, 12 insertions, 16 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 6a397361d2a..20ac736e424 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -1396,7 +1396,7 @@ WAIT_AGAIN:
// Finally, start monitoring the child process for change in state.
m_monitor_thread = Host::StartMonitoringChildProcess(
NativeProcessLinux::MonitorCallback, this, GetID(), true);
- if (m_monitor_thread.GetState() != eThreadStateRunning)
+ if (!m_monitor_thread.IsJoinable())
{
error.SetErrorToGenericError();
error.SetErrorString ("Process attach failed to create monitor thread for NativeProcessLinux::MonitorCallback.");
@@ -1474,7 +1474,7 @@ WAIT_AGAIN:
// Finally, start monitoring the child process for change in state.
m_monitor_thread = Host::StartMonitoringChildProcess (
NativeProcessLinux::MonitorCallback, this, GetID (), true);
- if (m_monitor_thread.GetState() != eThreadStateRunning)
+ if (!m_monitor_thread.IsJoinable())
{
error.SetErrorToGenericError ();
error.SetErrorString ("Process attach failed to create monitor thread for NativeProcessLinux::MonitorCallback.");
@@ -1495,7 +1495,7 @@ NativeProcessLinux::StartLaunchOpThread(LaunchArgs *args, Error &error)
{
static const char *g_thread_name = "lldb.process.nativelinux.operation";
- if (m_operation_thread.GetState() == eThreadStateRunning)
+ if (m_operation_thread.IsJoinable())
return;
m_operation_thread = ThreadLauncher::LaunchThread(g_thread_name, LaunchOpThread, args, &error);
@@ -1804,7 +1804,7 @@ NativeProcessLinux::StartAttachOpThread(AttachArgs *args, lldb_private::Error &e
{
static const char *g_thread_name = "lldb.process.linux.operation";
- if (m_operation_thread.GetState() == eThreadStateRunning)
+ if (m_operation_thread.IsJoinable())
return;
m_operation_thread = ThreadLauncher::LaunchThread(g_thread_name, AttachOpThread, args, &error);
@@ -3645,11 +3645,10 @@ NativeProcessLinux::DupDescriptor(const char *path, int fd, int flags)
void
NativeProcessLinux::StopMonitoringChildProcess()
{
- if (m_monitor_thread.GetState() == eThreadStateRunning)
+ if (m_monitor_thread.IsJoinable())
{
m_monitor_thread.Cancel();
m_monitor_thread.Join(nullptr);
- m_monitor_thread.Reset();
}
}
@@ -3671,12 +3670,11 @@ NativeProcessLinux::StopMonitor()
void
NativeProcessLinux::StopOpThread()
{
- if (m_operation_thread.GetState() != eThreadStateRunning)
+ if (!m_operation_thread.IsJoinable())
return;
m_operation_thread.Cancel();
m_operation_thread.Join(nullptr);
- m_operation_thread.Reset();
}
bool
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index 99d14d2aa7b..8f626be0581 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -1199,7 +1199,7 @@ WAIT_AGAIN:
// Finally, start monitoring the child process for change in state.
m_monitor_thread = Host::StartMonitoringChildProcess(
ProcessMonitor::MonitorCallback, this, GetPID(), true);
- if (m_monitor_thread.GetState() != eThreadStateRunning)
+ if (!m_monitor_thread.IsJoinable())
{
error.SetErrorToGenericError();
error.SetErrorString("Process launch failed.");
@@ -1250,7 +1250,7 @@ WAIT_AGAIN:
// Finally, start monitoring the child process for change in state.
m_monitor_thread = Host::StartMonitoringChildProcess(
ProcessMonitor::MonitorCallback, this, GetPID(), true);
- if (m_monitor_thread.GetState() != eThreadStateRunning)
+ if (!m_monitor_thread.IsJoinable())
{
error.SetErrorToGenericError();
error.SetErrorString("Process attach failed.");
@@ -1270,7 +1270,7 @@ ProcessMonitor::StartLaunchOpThread(LaunchArgs *args, Error &error)
{
static const char *g_thread_name = "lldb.process.linux.operation";
- if (m_operation_thread.GetState() == eThreadStateRunning)
+ if (m_operation_thread.IsJoinable())
return;
m_operation_thread = ThreadLauncher::LaunchThread(g_thread_name, LaunchOpThread, args, &error);
@@ -1493,7 +1493,7 @@ ProcessMonitor::StartAttachOpThread(AttachArgs *args, lldb_private::Error &error
{
static const char *g_thread_name = "lldb.process.linux.operation";
- if (m_operation_thread.GetState() == eThreadStateRunning)
+ if (m_operation_thread.IsJoinable())
return;
m_operation_thread = ThreadLauncher::LaunchThread(g_thread_name, AttachOpThread, args, &error);
@@ -2466,11 +2466,10 @@ ProcessMonitor::DupDescriptor(const char *path, int fd, int flags)
void
ProcessMonitor::StopMonitoringChildProcess()
{
- if (m_monitor_thread.GetState() == eThreadStateRunning)
+ if (m_monitor_thread.IsJoinable())
{
m_monitor_thread.Cancel();
m_monitor_thread.Join(nullptr);
- m_monitor_thread.Reset();
}
}
@@ -2491,10 +2490,9 @@ ProcessMonitor::StopMonitor()
void
ProcessMonitor::StopOpThread()
{
- if (m_operation_thread.GetState() != eThreadStateRunning)
+ if (!m_operation_thread.IsJoinable())
return;
m_operation_thread.Cancel();
m_operation_thread.Join(nullptr);
- m_operation_thread.Reset();
}
OpenPOWER on IntegriCloud