|
LLDB mainline
|
A move-only RAII handle that pairs a pointer-like value with an exclusive lock on a caller-supplied mutex. More...
#include <Locked.h>
Public Types | |
| using | mutex_type = Mutex |
| using | lock_type = std::unique_lock<Mutex> |
Public Member Functions | |
| Locked ()=default | |
| Locked (mutex_type &m, PtrT p) | |
| Locked (lock_type lock, PtrT p) | |
| Locked (Locked &&other) | |
| Locked & | operator= (Locked &&other) |
| Locked (const Locked &)=delete | |
| Locked & | operator= (const Locked &)=delete |
| Public Member Functions inherited from lldb_private::detail::LockedAccessors< Locked< PtrT, std::recursive_mutex >, PtrT > | |
| auto | operator-> () const |
| decltype(auto) | operator* () const |
| auto | get () const |
| operator bool () const | |
Private Attributes | |
| lock_type | m_lock |
| PtrT | m_ptr {} |
Friends | |
| class | detail::LockedAccessors< Locked< PtrT, Mutex >, PtrT > |
A move-only RAII handle that pairs a pointer-like value with an exclusive lock on a caller-supplied mutex.
While the handle is alive the borrowed pointer is serialized against other threads that go through the same mutex.
PtrT is the pointer-like value: a raw pointer (T*), std::shared_ptr<T>, or std::unique_ptr<T>. Mutex may be any type that satisfies Lockable — std::mutex, std::recursive_mutex, std::shared_mutex, or llvm::sys::RWMutex all work. Use the LockedPtr, LockedSP, LockedUP aliases for the common combinations.
| using lldb_private::Locked< PtrT, Mutex >::lock_type = std::unique_lock<Mutex> |
| using lldb_private::Locked< PtrT, Mutex >::mutex_type = Mutex |
|
default |
|
inline |
|
inline |
|
inline |
|
delete |
|
delete |
|
inline |
|
friend |
|
private |
|
private |