1 //===-- HostThread.cpp ------------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/Host/HostThread.h" 11 #include "lldb/Host/HostNativeThread.h" 12 13 using namespace lldb; 14 using namespace lldb_private; 15 HostThread()16HostThread::HostThread() : m_native_thread(new HostNativeThread) {} 17 HostThread(lldb::thread_t thread)18HostThread::HostThread(lldb::thread_t thread) 19 : m_native_thread(new HostNativeThread(thread)) {} 20 Join(lldb::thread_result_t * result)21Status HostThread::Join(lldb::thread_result_t *result) { 22 return m_native_thread->Join(result); 23 } 24 Cancel()25Status HostThread::Cancel() { return m_native_thread->Cancel(); } 26 Reset()27void HostThread::Reset() { return m_native_thread->Reset(); } 28 Release()29lldb::thread_t HostThread::Release() { return m_native_thread->Release(); } 30 IsJoinable() const31bool HostThread::IsJoinable() const { return m_native_thread->IsJoinable(); } 32 GetNativeThread()33HostNativeThread &HostThread::GetNativeThread() { 34 return static_cast<HostNativeThread &>(*m_native_thread); 35 } 36 GetNativeThread() const37const HostNativeThread &HostThread::GetNativeThread() const { 38 return static_cast<const HostNativeThread &>(*m_native_thread); 39 } 40 GetResult() const41lldb::thread_result_t HostThread::GetResult() const { 42 return m_native_thread->GetResult(); 43 } 44 EqualsThread(lldb::thread_t thread) const45bool HostThread::EqualsThread(lldb::thread_t thread) const { 46 return m_native_thread->EqualsThread(thread); 47 } 48