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"
14#include "lldb/lldb-defines.h"
15#include "lldb/lldb-types.h"
16
17namespace lldb_private {
18
19#if defined(_WIN32)
20#define THREAD_ROUTINE __stdcall
21#else
22#define THREAD_ROUTINE
23#endif
24
26 friend class ThreadLauncher;
29
30public:
32 explicit HostNativeThreadBase(lldb::thread_t thread);
33 virtual ~HostNativeThreadBase() = default;
34
35 virtual Status Join(lldb::thread_result_t *result) = 0;
36 virtual Status Cancel() = 0;
37 virtual bool IsJoinable() const;
38 virtual void Reset();
39 virtual bool EqualsThread(lldb::thread_t thread) const;
42
45
46protected:
49
51 lldb::thread_result_t m_result = 0; // NOLINT(modernize-use-nullptr)
52};
53}
54
55#endif
#define THREAD_ROUTINE
lldb::thread_result_t GetResult() const
static lldb::thread_result_t THREAD_ROUTINE ThreadCreateTrampoline(lldb::thread_arg_t arg)
virtual StructuredData::ObjectSP GetExtendedInfo() const
virtual Status Join(lldb::thread_result_t *result)=0
virtual bool EqualsThread(lldb::thread_t thread) const
virtual ~HostNativeThreadBase()=default
const HostNativeThreadBase & operator=(const HostNativeThreadBase &)=delete
HostNativeThreadBase(const HostNativeThreadBase &)=delete
An error handling class.
Definition Status.h:118
std::shared_ptr< Object > ObjectSP
#define LLDB_INVALID_HOST_THREAD
Definition lldb-types.h:69
A class that represents a running process on the host machine.
void * thread_arg_t
Definition lldb-types.h:61
void * thread_result_t
Definition lldb-types.h:62
pthread_t thread_t
Definition lldb-types.h:58