[PATCH] D53357: [Windows] Fix threads comparison on Windows
Aleksandr Urakov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 18 00:56:21 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL344729: [Windows] Fix threads comparison on Windows (authored by aleksandr.urakov, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D53357?vs=169966&id=170047#toc
Repository:
rL LLVM
https://reviews.llvm.org/D53357
Files:
lldb/trunk/include/lldb/Host/HostNativeThreadBase.h
lldb/trunk/include/lldb/Host/windows/HostThreadWindows.h
lldb/trunk/source/Host/common/HostNativeThreadBase.cpp
lldb/trunk/source/Host/common/HostThread.cpp
lldb/trunk/source/Host/windows/HostThreadWindows.cpp
Index: lldb/trunk/include/lldb/Host/windows/HostThreadWindows.h
===================================================================
--- lldb/trunk/include/lldb/Host/windows/HostThreadWindows.h
+++ lldb/trunk/include/lldb/Host/windows/HostThreadWindows.h
@@ -29,6 +29,7 @@
virtual Status Join(lldb::thread_result_t *result);
virtual Status Cancel();
virtual void Reset();
+ virtual bool EqualsThread(lldb::thread_t thread) const;
lldb::tid_t GetThreadId() const;
Index: lldb/trunk/include/lldb/Host/HostNativeThreadBase.h
===================================================================
--- lldb/trunk/include/lldb/Host/HostNativeThreadBase.h
+++ lldb/trunk/include/lldb/Host/HostNativeThreadBase.h
@@ -35,6 +35,7 @@
virtual Status Cancel() = 0;
virtual bool IsJoinable() const;
virtual void Reset();
+ virtual bool EqualsThread(lldb::thread_t thread) const;
lldb::thread_t Release();
lldb::thread_t GetSystemHandle() const;
Index: lldb/trunk/source/Host/windows/HostThreadWindows.cpp
===================================================================
--- lldb/trunk/source/Host/windows/HostThreadWindows.cpp
+++ lldb/trunk/source/Host/windows/HostThreadWindows.cpp
@@ -69,3 +69,7 @@
HostNativeThreadBase::Reset();
}
+
+bool HostThreadWindows::EqualsThread(lldb::thread_t thread) const {
+ return GetThreadId() == ::GetThreadId(thread);
+}
Index: lldb/trunk/source/Host/common/HostNativeThreadBase.cpp
===================================================================
--- lldb/trunk/source/Host/common/HostNativeThreadBase.cpp
+++ lldb/trunk/source/Host/common/HostNativeThreadBase.cpp
@@ -41,6 +41,10 @@
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;
Index: lldb/trunk/source/Host/common/HostThread.cpp
===================================================================
--- lldb/trunk/source/Host/common/HostThread.cpp
+++ lldb/trunk/source/Host/common/HostThread.cpp
@@ -43,5 +43,5 @@
}
bool HostThread::EqualsThread(lldb::thread_t thread) const {
- return m_native_thread->GetSystemHandle() == thread;
+ return m_native_thread->EqualsThread(thread);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53357.170047.patch
Type: text/x-patch
Size: 2319 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181018/51a366aa/attachment-0001.bin>
More information about the llvm-commits
mailing list