Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:49

0001 //===-- HostNativeThreadBase.h ----------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_HOST_HOSTNATIVETHREADBASE_H
0010 #define LLDB_HOST_HOSTNATIVETHREADBASE_H
0011 
0012 #include "lldb/Utility/Status.h"
0013 #include "lldb/lldb-defines.h"
0014 #include "lldb/lldb-types.h"
0015 
0016 namespace lldb_private {
0017 
0018 #if defined(_WIN32)
0019 #define THREAD_ROUTINE __stdcall
0020 #else
0021 #define THREAD_ROUTINE
0022 #endif
0023 
0024 class HostNativeThreadBase {
0025   friend class ThreadLauncher;
0026   HostNativeThreadBase(const HostNativeThreadBase &) = delete;
0027   const HostNativeThreadBase &operator=(const HostNativeThreadBase &) = delete;
0028 
0029 public:
0030   HostNativeThreadBase() = default;
0031   explicit HostNativeThreadBase(lldb::thread_t thread);
0032   virtual ~HostNativeThreadBase() = default;
0033 
0034   virtual Status Join(lldb::thread_result_t *result) = 0;
0035   virtual Status Cancel() = 0;
0036   virtual bool IsJoinable() const;
0037   virtual void Reset();
0038   virtual bool EqualsThread(lldb::thread_t thread) const;
0039   lldb::thread_t Release();
0040 
0041   lldb::thread_t GetSystemHandle() const;
0042   lldb::thread_result_t GetResult() const;
0043 
0044 protected:
0045   static lldb::thread_result_t THREAD_ROUTINE
0046   ThreadCreateTrampoline(lldb::thread_arg_t arg);
0047 
0048   lldb::thread_t m_thread = LLDB_INVALID_HOST_THREAD;
0049   lldb::thread_result_t m_result = 0; // NOLINT(modernize-use-nullptr)
0050 };
0051 }
0052 
0053 #endif