diff options
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 14 |
1 files changed, 6 insertions, 8 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 |