diff options
author | Zachary Turner <zturner@google.com> | 2014-11-05 22:16:28 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2014-11-05 22:16:28 +0000 |
commit | 742346a22f591938ea8d0f10a9ae6135649d0057 (patch) | |
tree | 981d81eca5886f59a75c88f9008db9c3956b7561 /lldb/source/Host/windows/HostThreadWindows.cpp | |
parent | 1839abdabe24a8a5211e21c71769253d5cf69d1d (diff) | |
download | bcm5719-llvm-742346a22f591938ea8d0f10a9ae6135649d0057.tar.gz bcm5719-llvm-742346a22f591938ea8d0f10a9ae6135649d0057.zip |
Decouple ProcessWindows from the Windows debug driver thread.
In the llgs world, ProcessWindows will eventually go away and
we'll implement a different protocol. This patch decouples
ProcessWindows from the core debug loop so that this transition
will not be more difficult than it needs to be.
llvm-svn: 221405
Diffstat (limited to 'lldb/source/Host/windows/HostThreadWindows.cpp')
-rw-r--r-- | lldb/source/Host/windows/HostThreadWindows.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Host/windows/HostThreadWindows.cpp b/lldb/source/Host/windows/HostThreadWindows.cpp index 25d5c72b4a4..2597fa29941 100644 --- a/lldb/source/Host/windows/HostThreadWindows.cpp +++ b/lldb/source/Host/windows/HostThreadWindows.cpp @@ -19,11 +19,13 @@ using namespace lldb_private; HostThreadWindows::HostThreadWindows() : HostNativeThreadBase() + , m_owns_handle(true) { } HostThreadWindows::HostThreadWindows(lldb::thread_t thread) : HostNativeThreadBase(thread) + , m_owns_handle(true) { } @@ -32,6 +34,12 @@ HostThreadWindows::~HostThreadWindows() Reset(); } +void +HostThreadWindows::SetOwnsHandle(bool owns) +{ + m_owns_handle = owns; +} + Error HostThreadWindows::Join(lldb::thread_result_t *result) { @@ -75,7 +83,7 @@ HostThreadWindows::GetThreadId() const void HostThreadWindows::Reset() { - if (m_thread != LLDB_INVALID_HOST_THREAD) + if (m_owns_handle && m_thread != LLDB_INVALID_HOST_THREAD) ::CloseHandle(m_thread); HostNativeThreadBase::Reset(); |