LLDB
mainline
llvm-project
lldb
source
Host
common
HostThread.cpp
Go to the documentation of this file.
1
//===-- HostThread.cpp ----------------------------------------------------===//
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
#include "
lldb/Host/HostThread.h
"
10
#include "
lldb/Host/HostNativeThread.h
"
11
12
using namespace
lldb
;
13
using namespace
lldb_private
;
14
15
HostThread::HostThread
() :
m_native_thread
(new
HostNativeThread
) {}
16
17
HostThread::HostThread
(
lldb::thread_t
thread)
18
:
m_native_thread
(new
HostNativeThread
(thread)) {}
19
20
Status
HostThread::Join
(
lldb::thread_result_t
*result) {
21
return
m_native_thread
->Join(result);
22
}
23
24
Status
HostThread::Cancel
() {
return
m_native_thread
->Cancel(); }
25
26
void
HostThread::Reset
() {
return
m_native_thread
->Reset(); }
27
28
lldb::thread_t
HostThread::Release
() {
return
m_native_thread
->Release(); }
29
30
bool
HostThread::IsJoinable
()
const
{
return
m_native_thread
->IsJoinable(); }
31
32
HostNativeThread
&
HostThread::GetNativeThread
() {
33
return
static_cast<
HostNativeThread
&
>
(*m_native_thread);
34
}
35
36
const
HostNativeThread
&
HostThread::GetNativeThread
()
const
{
37
return
static_cast<
const
HostNativeThread
&
>
(*m_native_thread);
38
}
39
40
lldb::thread_result_t
HostThread::GetResult
()
const
{
41
return
m_native_thread
->GetResult();
42
}
43
44
bool
HostThread::EqualsThread
(
lldb::thread_t
thread)
const
{
45
return
m_native_thread
->EqualsThread(thread);
46
}
47
48
bool
HostThread::EqualsThread
(
const
HostThread
&thread)
const
{
49
return
m_native_thread
->EqualsThread(
50
thread.GetNativeThread().GetSystemHandle());
51
}
52
53
bool
HostThread::HasThread
()
const
{
54
if
(!
m_native_thread
)
55
return
false
;
56
return
m_native_thread
->GetSystemHandle() !=
LLDB_INVALID_HOST_THREAD
;
57
}
HostNativeThread.h
HostThread.h
lldb_private::HostThread::Join
Status Join(lldb::thread_result_t *result)
Definition
HostThread.cpp:20
lldb_private::HostThread::Release
lldb::thread_t Release()
Definition
HostThread.cpp:28
lldb_private::HostThread::HasThread
bool HasThread() const
Definition
HostThread.cpp:53
lldb_private::HostThread::Reset
void Reset()
Definition
HostThread.cpp:26
lldb_private::HostThread::Cancel
Status Cancel()
Definition
HostThread.cpp:24
lldb_private::HostThread::IsJoinable
bool IsJoinable() const
Definition
HostThread.cpp:30
lldb_private::HostThread::HostThread
HostThread()
Definition
HostThread.cpp:15
lldb_private::HostThread::GetResult
lldb::thread_result_t GetResult() const
Definition
HostThread.cpp:40
lldb_private::HostThread::m_native_thread
std::shared_ptr< HostNativeThreadBase > m_native_thread
Definition
HostThread.h:50
lldb_private::HostThread::EqualsThread
bool EqualsThread(lldb::thread_t thread) const
Definition
HostThread.cpp:44
lldb_private::HostThread::GetNativeThread
HostNativeThread & GetNativeThread()
Definition
HostThread.cpp:32
lldb_private::Status
An error handling class.
Definition
Status.h:118
LLDB_INVALID_HOST_THREAD
#define LLDB_INVALID_HOST_THREAD
Definition
lldb-types.h:69
lldb_private
A class that represents a running process on the host machine.
Definition
SBAddressRange.h:14
lldb_private::HostNativeThread
HostThreadPosix HostNativeThread
Definition
HostNativeThreadForward.h:21
lldb
Definition
SBAddress.h:15
lldb::thread_result_t
void * thread_result_t
Definition
lldb-types.h:62
lldb::thread_t
pthread_t thread_t
Definition
lldb-types.h:58
Generated on
for LLDB by
1.14.0