diff options
author | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2018-10-18 07:52:56 +0000 |
---|---|---|
committer | Aleksandr Urakov <aleksandr.urakov@jetbrains.com> | 2018-10-18 07:52:56 +0000 |
commit | 64c92df7cb58baba7a228cdca453678c5c531da6 (patch) | |
tree | e71d53ff1832b88ba5c4982c236190a22634dd16 /lldb/source/Host/common/HostNativeThreadBase.cpp | |
parent | 11b89c56cccd8bf7e5523e8f14610967a287e6a0 (diff) | |
download | bcm5719-llvm-64c92df7cb58baba7a228cdca453678c5c531da6.tar.gz bcm5719-llvm-64c92df7cb58baba7a228cdca453678c5c531da6.zip |
[Windows] Fix threads comparison on Windows
Summary:
This patch makes Windows threads to compare by a thread ID, not by a handle.
It's because the same thread can have different handles on Windows
(for example, `GetCurrentThread` always returns the fake handle `-2`).
This leads to some incorrect behavior. For example, in `Process::GetRunLock`
always `m_public_run_lock` is returned without this patch.
Reviewers: zturner, clayborg, stella.stamenova
Reviewed By: stella.stamenova
Subscribers: stella.stamenova, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D53357
llvm-svn: 344729
Diffstat (limited to 'lldb/source/Host/common/HostNativeThreadBase.cpp')
-rw-r--r-- | lldb/source/Host/common/HostNativeThreadBase.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Host/common/HostNativeThreadBase.cpp b/lldb/source/Host/common/HostNativeThreadBase.cpp index 402d3caacfc..25c8066bb1a 100644 --- a/lldb/source/Host/common/HostNativeThreadBase.cpp +++ b/lldb/source/Host/common/HostNativeThreadBase.cpp @@ -41,6 +41,10 @@ void HostNativeThreadBase::Reset() { m_result = 0; } +bool HostNativeThreadBase::EqualsThread(lldb::thread_t thread) const { + return m_thread == thread; +} + lldb::thread_t HostNativeThreadBase::Release() { lldb::thread_t result = m_thread; m_thread = LLDB_INVALID_HOST_THREAD; |