|
LLDB mainline
|
RAII helper around the read-lock side of ProcessRunLock. More...
#include <ProcessRunLock.h>
Public Member Functions | |
| ProcessRunLocker ()=default | |
| ProcessRunLocker (ProcessRunLocker &&other) | |
| ProcessRunLocker & | operator= (ProcessRunLocker &&other) |
| ~ProcessRunLocker () | |
| bool | IsLocked () const |
| bool | TryLock (ProcessRunLock *lock) |
| Try to acquire the read lock. | |
Protected Member Functions | |
| void | Unlock () |
Protected Attributes | |
| ProcessRunLock * | m_lock = nullptr |
| uint64_t | m_thread = 0 |
Private Member Functions | |
| ProcessRunLocker (const ProcessRunLocker &)=delete | |
| const ProcessRunLocker & | operator= (const ProcessRunLocker &)=delete |
RAII helper around the read-lock side of ProcessRunLock.
Supports same-thread recursion (see class doc).
Move-assignment unlocks the destination first, then takes the source's lock. Cross-thread move of a held locker is fatal — the same thread that called rdlock must call unlock.
Definition at line 52 of file ProcessRunLock.h.
|
default |
References ProcessRunLocker().
Referenced by operator=(), operator=(), ProcessRunLocker(), ProcessRunLocker(), and ProcessRunLocker().
| lldb_private::ProcessRunLock::ProcessRunLocker::ProcessRunLocker | ( | ProcessRunLocker && | other | ) |
Definition at line 63 of file common/ProcessRunLock.cpp.
References m_lock, m_thread, and ProcessRunLocker().
|
inline |
Definition at line 57 of file ProcessRunLock.h.
References Unlock().
|
privatedelete |
References ProcessRunLocker().
|
inline |
Definition at line 59 of file ProcessRunLock.h.
References m_lock.
|
privatedelete |
References ProcessRunLocker().
| ProcessRunLock::ProcessRunLocker & lldb_private::ProcessRunLock::ProcessRunLocker::operator= | ( | ProcessRunLocker && | other | ) |
Definition at line 74 of file common/ProcessRunLock.cpp.
References m_lock, m_thread, ProcessRunLocker(), and Unlock().
| bool lldb_private::ProcessRunLock::ProcessRunLocker::TryLock | ( | ProcessRunLock * | lock | ) |
Try to acquire the read lock.
If this thread already holds the read lock on this ProcessRunLock, the underlying rwlock is bypassed and the per-instance recursion count for this thread is bumped instead.
Definition at line 87 of file common/ProcessRunLock.cpp.
References m_lock, lldb_private::ProcessRunLock::m_recursion, lldb_private::ProcessRunLock::m_recursion_mutex, m_thread, lldb_private::ProcessRunLock::ProcessRunLock(), lldb_private::ProcessRunLock::ReadTryLock(), and Unlock().
Referenced by lldb::SBProcess::AllocateMemory(), lldb::SBProcess::DeallocateMemory(), lldb::SBTarget::EvaluateExpression(), lldb_private::QueueImpl::FetchItems(), lldb_private::QueueImpl::FetchThreads(), lldb::SBProcess::FindInMemory(), lldb::SBProcess::FindRangesInMemory(), lldb::SBQueueItem::GetExtendedBacktraceThread(), lldb::SBProcess::GetMemoryRegionInfo(), lldb::SBProcess::GetMemoryRegions(), lldb::SBProcess::GetNumQueues(), lldb::SBProcess::GetNumThreads(), lldb::SBProcess::GetQueueAtIndex(), lldb_private::ValueImpl::GetSP(), lldb_private::GetStoppedExecutionContext(), lldb::SBProcess::GetThreadAtIndex(), lldb::SBProcess::GetThreadByID(), lldb::SBProcess::GetThreadByIndexID(), lldb::SBProcess::LoadImage(), lldb::SBProcess::LoadImageUsingPaths(), lldb::SBProcess::ReadCStringFromMemory(), lldb::SBProcess::ReadMemory(), lldb::SBProcess::ReadPointerFromMemory(), lldb::SBProcess::ReadUnsignedFromMemory(), lldb::SBProcess::SendEventData(), lldb_private::ExecutionContextRef::SetProcessPtr(), lldb_private::ExecutionContextRef::SetThreadPtr(), lldb::SBProcess::UnloadImage(), and lldb::SBProcess::WriteMemory().
|
protected |
Definition at line 123 of file common/ProcessRunLock.cpp.
References m_lock, and m_thread.
Referenced by operator=(), TryLock(), and ~ProcessRunLocker().
|
protected |
Definition at line 70 of file ProcessRunLock.h.
Referenced by IsLocked(), operator=(), ProcessRunLocker(), TryLock(), and Unlock().
|
protected |
Definition at line 71 of file ProcessRunLock.h.
Referenced by operator=(), ProcessRunLocker(), TryLock(), and Unlock().