LLDB mainline
HostThread.h
Go to the documentation of this file.
1//===-- HostThread.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_HOSTTHREAD_H
10#define LLDB_HOST_HOSTTHREAD_H
11
13#include "lldb/Utility/Status.h"
14#include "lldb/lldb-types.h"
15#include "llvm/ADT/DenseMapInfo.h"
16
17#include <memory>
18
19namespace lldb_private {
20
22
23/// \class HostInfo HostInfo.h "lldb/Host/HostThread.h"
24/// A class that represents a thread running inside of a process on the
25/// local machine.
26///
27/// HostThread allows querying and manipulation of threads running on the host
28/// machine.
29///
31public:
32 HostThread();
34
36 Status Cancel();
37 void Reset();
39
40 bool IsJoinable() const;
42 const HostNativeThread &GetNativeThread() const;
44
45 bool EqualsThread(lldb::thread_t thread) const;
46 bool EqualsThread(const HostThread &thread) const;
47
48 bool HasThread() const;
49
50private:
51 std::shared_ptr<HostNativeThreadBase> m_native_thread;
52};
53}
54
55namespace llvm {
56template <> struct DenseMapInfo<lldb_private::HostThread> {
59 DenseMapInfo<lldb::thread_t>::getEmptyKey());
60 }
63 DenseMapInfo<lldb::thread_t>::getTombstoneKey());
64 }
65 static unsigned getHashValue(const lldb_private::HostThread &val);
66 static bool isEqual(const lldb_private::HostThread &lhs,
67 const lldb_private::HostThread &rhs);
68};
69} // namespace llvm
70
71#endif
Status Join(lldb::thread_result_t *result)
lldb::thread_t Release()
lldb::thread_result_t GetResult() const
std::shared_ptr< HostNativeThreadBase > m_native_thread
Definition HostThread.h:51
bool EqualsThread(lldb::thread_t thread) const
HostNativeThread & GetNativeThread()
An error handling class.
Definition Status.h:118
A class that represents a running process on the host machine.
HostThreadPosix HostNativeThread
void * thread_result_t
Definition lldb-types.h:62
pthread_t thread_t
Definition lldb-types.h:58
static lldb_private::HostThread getTombstoneKey()
Definition HostThread.h:61
static unsigned getHashValue(const lldb_private::HostThread &val)
static lldb_private::HostThread getEmptyKey()
Definition HostThread.h:57
static bool isEqual(const lldb_private::HostThread &lhs, const lldb_private::HostThread &rhs)