|
LLDB mainline
|
Read/write lock around the process running/stopped state. More...
#include "lldb/Host/ProcessRunLock.h"
Classes | |
| class | ProcessRunLocker |
| RAII helper around the read-lock side of ProcessRunLock. More... | |
Public Member Functions | |
| ProcessRunLock () | |
| ~ProcessRunLock () | |
| bool | SetRunning () |
| Set the process to running. | |
| bool | SetStopped () |
| Set the process to stopped. | |
Protected Attributes | |
| lldb::rwlock_t | m_rwlock |
| bool | m_running = false |
Private Member Functions | |
| ProcessRunLock (const ProcessRunLock &)=delete | |
| const ProcessRunLock & | operator= (const ProcessRunLock &)=delete |
| bool | ReadTryLock () |
| bool | ReadUnlock () |
Private Attributes | |
| std::mutex | m_recursion_mutex |
| llvm::DenseMap< uint64_t, uint32_t > | m_recursion |
Friends | |
| class | ProcessRunLocker |
Read/write lock around the process running/stopped state.
POSIX rwlocks aren't reader-recursive: a thread holding the read lock can deadlock against a pending writer if it re-acquires directly. ProcessRunLocker tracks a per-thread recursion count so re-entry skips the rwlock; the raw primitives are private.
Definition at line 33 of file ProcessRunLock.h.
| ProcessRunLock::ProcessRunLock | ( | ) |
Definition at line 21 of file common/ProcessRunLock.cpp.
References m_rwlock.
Referenced by operator=(), ProcessRunLock(), and lldb_private::ProcessRunLock::ProcessRunLocker::TryLock().
| ProcessRunLock::~ProcessRunLock | ( | ) |
Definition at line 26 of file common/ProcessRunLock.cpp.
References m_rwlock.
|
privatedelete |
References ProcessRunLock().
|
privatedelete |
References ProcessRunLock().
|
private |
Definition at line 31 of file common/ProcessRunLock.cpp.
References m_running, and m_rwlock.
Referenced by lldb_private::ProcessRunLock::ProcessRunLocker::TryLock().
|
private |
Definition at line 41 of file common/ProcessRunLock.cpp.
References m_rwlock.
| bool ProcessRunLock::SetRunning | ( | ) |
Set the process to running.
Returns true if the process was stopped. Return false if the process was running.
Definition at line 45 of file common/ProcessRunLock.cpp.
| bool ProcessRunLock::SetStopped | ( | ) |
Set the process to stopped.
Returns true if the process was running. Returns false if the process was stopped.
Definition at line 53 of file common/ProcessRunLock.cpp.
|
friend |
Definition at line 88 of file ProcessRunLock.h.
Referenced by lldb_private::StoppedExecutionContext::AllowResume().
|
private |
Definition at line 91 of file ProcessRunLock.h.
Referenced by lldb_private::ProcessRunLock::ProcessRunLocker::TryLock().
|
private |
Definition at line 90 of file ProcessRunLock.h.
Referenced by lldb_private::ProcessRunLock::ProcessRunLocker::TryLock().
|
protected |
Definition at line 80 of file ProcessRunLock.h.
Referenced by ReadTryLock(), SetRunning(), and SetStopped().
|
protected |
Definition at line 79 of file ProcessRunLock.h.
Referenced by ProcessRunLock(), ReadTryLock(), ReadUnlock(), SetRunning(), SetStopped(), and ~ProcessRunLock().