1 //===-- HostNativeThreadBase.h ----------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef lldb_Host_HostNativeThreadBase_h_
10 #define lldb_Host_HostNativeThreadBase_h_
12 #include "lldb/Utility/Status.h"
13 #include "lldb/lldb-defines.h"
14 #include "lldb/lldb-types.h"
16 namespace lldb_private {
19 #define THREAD_ROUTINE __stdcall
21 #define THREAD_ROUTINE
24 class HostNativeThreadBase {
25 friend class ThreadLauncher;
26 DISALLOW_COPY_AND_ASSIGN(HostNativeThreadBase);
29 HostNativeThreadBase();
30 explicit HostNativeThreadBase(lldb::thread_t thread);
31 virtual ~HostNativeThreadBase() {}
33 virtual Status Join(lldb::thread_result_t *result) = 0;
34 virtual Status Cancel() = 0;
35 virtual bool IsJoinable() const;
37 virtual bool EqualsThread(lldb::thread_t thread) 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;