1 //===-- HostThread.cpp ----------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "lldb/Host/HostThread.h" 10 #include "lldb/Host/HostNativeThread.h" 11 12 using namespace lldb; 13 using namespace lldb_private; 14 HostThread()15HostThread::HostThread() : m_native_thread(new HostNativeThread) {} 16 HostThread(lldb::thread_t thread)17HostThread::HostThread(lldb::thread_t thread) 18 : m_native_thread(new HostNativeThread(thread)) {} 19 Join(lldb::thread_result_t * result)20Status HostThread::Join(lldb::thread_result_t *result) { 21 return m_native_thread->Join(result); 22 } 23 Cancel()24Status HostThread::Cancel() { return m_native_thread->Cancel(); } 25 Reset()26void HostThread::Reset() { return m_native_thread->Reset(); } 27 Release()28lldb::thread_t HostThread::Release() { return m_native_thread->Release(); } 29 IsJoinable() const30bool HostThread::IsJoinable() const { return m_native_thread->IsJoinable(); } 31 GetNativeThread()32HostNativeThread &HostThread::GetNativeThread() { 33 return static_cast<HostNativeThread &>(*m_native_thread); 34 } 35 GetNativeThread() const36const HostNativeThread &HostThread::GetNativeThread() const { 37 return static_cast<const HostNativeThread &>(*m_native_thread); 38 } 39 GetResult() const40lldb::thread_result_t HostThread::GetResult() const { 41 return m_native_thread->GetResult(); 42 } 43 EqualsThread(lldb::thread_t thread) const44bool HostThread::EqualsThread(lldb::thread_t thread) const { 45 return m_native_thread->EqualsThread(thread); 46 } 47