summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2015-03-13 11:16:03 +0000
committerTamas Berghammer <tberghammer@google.com>2015-03-13 11:16:03 +0000
commit0cbf0b13e74a1334cd318517789f4c692faf524a (patch)
tree084407a98d8486979887ba6fcf4cc48d00f1c661 /lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
parent21212e4198a19e700cfd526d7fb14a58a351e5ed (diff)
downloadbcm5719-llvm-0cbf0b13e74a1334cd318517789f4c692faf524a.tar.gz
bcm5719-llvm-0cbf0b13e74a1334cd318517789f4c692faf524a.zip
Add code to exit the NativeProcessLinux Monitor thread on android
This CL change the logic used to terminate the monitor thread of NativeProcessLinux to use a signal instead of pthread_cancel as pthread_cancel is not supported on android. Differential revision: http://reviews.llvm.org/D8205 llvm-svn: 232155
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
index fcfda216231..00d4f44cbe3 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -24,6 +24,7 @@
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
#include "lldb/Host/Host.h"
+#include "lldb/Host/HostNativeThread.h"
#include "lldb/Host/HostThread.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Target/Thread.h"
@@ -94,6 +95,8 @@
using namespace lldb_private;
+static Operation* EXIT_OPERATION = nullptr;
+
// FIXME: this code is host-dependent with respect to types and
// endianness and needs to be fixed. For example, lldb::addr_t is
// hard-coded to uint64_t, but on a 32-bit Linux host, ptrace requires
@@ -2335,7 +2338,7 @@ ProcessMonitor::StopMonitoringChildProcess()
{
if (m_monitor_thread.IsJoinable())
{
- m_monitor_thread.Cancel();
+ ::pthread_kill(m_monitor_thread.GetNativeThread().GetSystemHandle(), SIGUSR1);
m_monitor_thread.Join(nullptr);
}
}
@@ -2359,6 +2362,6 @@ ProcessMonitor::StopOpThread()
if (!m_operation_thread.IsJoinable())
return;
- m_operation_thread.Cancel();
+ DoOperation(EXIT_OPERATION);
m_operation_thread.Join(nullptr);
}
OpenPOWER on IntegriCloud