summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.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/NativeProcessLinux.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/NativeProcessLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 9c7198e0d3c..7c9b32beda6 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -35,11 +35,12 @@
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
#include "lldb/Core/State.h"
+#include "lldb/Host/common/NativeRegisterContext.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
+#include "lldb/Host/HostNativeThread.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Host/common/NativeRegisterContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Utility/PseudoTerminal.h"
@@ -3557,11 +3558,11 @@ NativeProcessLinux::DupDescriptor(const char *path, int fd, int flags)
}
void
-NativeProcessLinux::StopMonitoringChildProcess()
+NativeProcessLinux::StopMonitorThread()
{
if (m_monitor_thread.IsJoinable())
{
- m_monitor_thread.Cancel();
+ ::pthread_kill(m_monitor_thread.GetNativeThread().GetSystemHandle(), SIGUSR1);
m_monitor_thread.Join(nullptr);
}
}
@@ -3569,7 +3570,7 @@ NativeProcessLinux::StopMonitoringChildProcess()
void
NativeProcessLinux::StopMonitor()
{
- StopMonitoringChildProcess();
+ StopMonitorThread();
StopCoordinatorThread ();
StopOpThread();
sem_destroy(&m_operation_pending);
OpenPOWER on IntegriCloud