1 //===-- HostNativeThreadBase.h ----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef lldb_Host_HostNativeThreadBase_h_
11 #define lldb_Host_HostNativeThreadBase_h_
13 #include "lldb/Utility/Status.h"
14 #include "lldb/lldb-defines.h"
15 #include "lldb/lldb-types.h"
17 namespace lldb_private {
20 #define THREAD_ROUTINE __stdcall
22 #define THREAD_ROUTINE
25 class HostNativeThreadBase {
26 friend class ThreadLauncher;
27 DISALLOW_COPY_AND_ASSIGN(HostNativeThreadBase);
30 HostNativeThreadBase();
31 explicit HostNativeThreadBase(lldb::thread_t thread);
32 virtual ~HostNativeThreadBase() {}
34 virtual Status Join(lldb::thread_result_t *result) = 0;
35 virtual Status Cancel() = 0;
36 virtual bool IsJoinable() const;
38 lldb::thread_t Release();
40 lldb::thread_t GetSystemHandle() const;
41 lldb::thread_result_t GetResult() const;
44 static lldb::thread_result_t THREAD_ROUTINE
45 ThreadCreateTrampoline(lldb::thread_arg_t arg);
47 lldb::thread_t m_thread;
48 lldb::thread_result_t m_result;