1//===-- HostThread.h --------------------------------------------*- 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#ifndef lldb_Host_HostThread_h_ 11#define lldb_Host_HostThread_h_ 12 13#include "lldb/Core/Error.h" 14#include "lldb/Host/HostNativeThreadForward.h" 15#include "lldb/lldb-types.h" 16 17#include <memory> 18 19namespace lldb_private 20{ 21 22class HostNativeThreadBase; 23 24//---------------------------------------------------------------------- 25/// @class HostInfo HostInfo.h "lldb/Host/HostThread.h" 26/// @brief A class that represents a thread running inside of a process on the 27/// local machine. 28/// 29/// HostThread allows querying and manipulation of threads running on the host 30/// machine. 31/// 32//---------------------------------------------------------------------- 33class HostThread 34{ 35 public: 36 HostThread(); 37 HostThread(lldb::thread_t thread); 38 39 Error Join(lldb::thread_result_t *result); 40 Error Cancel(); 41 void Reset(); 42 lldb::thread_t Release(); 43 44 bool IsJoinable() const; 45 HostNativeThread &GetNativeThread(); 46 const HostNativeThread &GetNativeThread() const; 47 lldb::thread_result_t GetResult() const; 48 49 bool EqualsThread(lldb::thread_t thread) const; 50 51 private: 52 std::shared_ptr<HostNativeThreadBase> m_native_thread; 53}; 54} 55 56#endif 57