summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/windows/HostThreadWindows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Host/windows/HostThreadWindows.cpp')
-rw-r--r--lldb/source/Host/windows/HostThreadWindows.cpp10
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();
OpenPOWER on IntegriCloud