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/Core/Error.h"
14 #include "lldb/lldb-defines.h"
15 #include "lldb/lldb-types.h"
17 namespace lldb_private
21 #define THREAD_ROUTINE __stdcall
23 #define THREAD_ROUTINE
26 class HostNativeThreadBase
28 friend class ThreadLauncher;
29 DISALLOW_COPY_AND_ASSIGN(HostNativeThreadBase);
32 HostNativeThreadBase();
33 explicit HostNativeThreadBase(lldb::thread_t thread);
34 virtual ~HostNativeThreadBase() {}
36 virtual Error Join(lldb::thread_result_t *result) = 0;
37 virtual Error Cancel() = 0;
38 virtual bool IsJoinable() const;
40 lldb::thread_t Release();
42 lldb::thread_t GetSystemHandle() const;
43 lldb::thread_result_t GetResult() const;
46 static lldb::thread_result_t THREAD_ROUTINE ThreadCreateTrampoline(lldb::thread_arg_t arg);
48 lldb::thread_t m_thread;
49 lldb::thread_result_t m_result;