LLDB  mainline
HostNativeThreadBase.h
Go to the documentation of this file.
1 //===-- HostNativeThreadBase.h ----------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_HOST_HOSTNATIVETHREADBASE_H
10 #define LLDB_HOST_HOSTNATIVETHREADBASE_H
11 
12 #include "lldb/Utility/Status.h"
13 #include "lldb/lldb-defines.h"
14 #include "lldb/lldb-types.h"
15 
16 namespace lldb_private {
17 
18 #if defined(_WIN32)
19 #define THREAD_ROUTINE __stdcall
20 #else
21 #define THREAD_ROUTINE
22 #endif
23 
25  friend class ThreadLauncher;
27  const HostNativeThreadBase &operator=(const HostNativeThreadBase &) = delete;
28 
29 public:
30  HostNativeThreadBase() = default;
31  explicit HostNativeThreadBase(lldb::thread_t thread);
32  virtual ~HostNativeThreadBase() = default;
33 
34  virtual Status Join(lldb::thread_result_t *result) = 0;
35  virtual Status Cancel() = 0;
36  virtual bool IsJoinable() const;
37  virtual void Reset();
38  virtual bool EqualsThread(lldb::thread_t thread) const;
40 
43 
44 protected:
47 
50 };
51 }
52 
53 #endif
lldb_private::HostNativeThreadBase::GetResult
lldb::thread_result_t GetResult() const
Definition: HostNativeThreadBase.cpp:27
lldb_private::ThreadLauncher
Definition: ThreadLauncher.h:20
lldb_private::HostNativeThreadBase::ThreadCreateTrampoline
static lldb::thread_result_t THREAD_ROUTINE ThreadCreateTrampoline(lldb::thread_arg_t arg)
Definition: HostNativeThreadBase.cpp:53
lldb_private::HostNativeThreadBase::Cancel
virtual Status Cancel()=0
lldb-defines.h
lldb_private::HostNativeThreadBase
Definition: HostNativeThreadBase.h:24
lldb_private::HostNativeThreadBase::Join
virtual Status Join(lldb::thread_result_t *result)=0
lldb::thread_t
pthread_t thread_t
Definition: lldb-types.h:58
lldb_private::HostNativeThreadBase::HostNativeThreadBase
HostNativeThreadBase()=default
lldb_private::HostNativeThreadBase::~HostNativeThreadBase
virtual ~HostNativeThreadBase()=default
lldb_private::HostNativeThreadBase::GetSystemHandle
lldb::thread_t GetSystemHandle() const
Definition: HostNativeThreadBase.cpp:23
lldb::thread_arg_t
void * thread_arg_t
Definition: lldb-types.h:61
lldb_private::HostNativeThreadBase::operator=
const HostNativeThreadBase & operator=(const HostNativeThreadBase &)=delete
lldb_private::HostNativeThreadBase::Release
lldb::thread_t Release()
Definition: HostNativeThreadBase.cpp:44
lldb_private::HostNativeThreadBase::IsJoinable
virtual bool IsJoinable() const
Definition: HostNativeThreadBase.cpp:31
lldb-types.h
THREAD_ROUTINE
#define THREAD_ROUTINE
Definition: HostNativeThreadBase.h:21
lldb_private::Status
Definition: Status.h:44
lldb::thread_result_t
void * thread_result_t
Definition: lldb-types.h:62
lldb_private::HostNativeThreadBase::m_result
lldb::thread_result_t m_result
Definition: HostNativeThreadBase.h:49
lldb_private::HostNativeThreadBase::Reset
virtual void Reset()
Definition: HostNativeThreadBase.cpp:35
Status.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::HostNativeThreadBase::EqualsThread
virtual bool EqualsThread(lldb::thread_t thread) const
Definition: HostNativeThreadBase.cpp:40
lldb_private::HostNativeThreadBase::m_thread
lldb::thread_t m_thread
Definition: HostNativeThreadBase.h:48
LLDB_INVALID_HOST_THREAD
#define LLDB_INVALID_HOST_THREAD
Definition: lldb-types.h:79