LLDB mainline
|
#include <LockFileBase.h>
Public Member Functions | |
virtual | ~LockFileBase ()=default |
bool | IsLocked () const |
Status | WriteLock (const uint64_t start, const uint64_t len) |
Status | TryWriteLock (const uint64_t start, const uint64_t len) |
Status | ReadLock (const uint64_t start, const uint64_t len) |
Status | TryReadLock (const uint64_t start, const uint64_t len) |
Status | Unlock () |
Protected Types | |
using | Locker = std::function< Status(const uint64_t, const uint64_t)> |
Protected Member Functions | |
LockFileBase (int fd) | |
virtual bool | IsValidFile () const |
virtual Status | DoWriteLock (const uint64_t start, const uint64_t len)=0 |
virtual Status | DoTryWriteLock (const uint64_t start, const uint64_t len)=0 |
virtual Status | DoReadLock (const uint64_t start, const uint64_t len)=0 |
virtual Status | DoTryReadLock (const uint64_t start, const uint64_t len)=0 |
virtual Status | DoUnlock ()=0 |
Status | DoLock (const Locker &locker, const uint64_t start, const uint64_t len) |
Protected Attributes | |
int | m_fd |
bool | m_locked |
uint64_t | m_start |
uint64_t | m_len |
Definition at line 18 of file LockFileBase.h.
|
protected |
Definition at line 33 of file LockFileBase.h.
|
virtualdefault |
|
protected |
Definition at line 20 of file LockFileBase.cpp.
|
protected |
Definition at line 64 of file LockFileBase.cpp.
References AlreadyLocked(), error(), lldb_private::Status::FromErrorString(), IsLocked(), IsValidFile(), m_len, m_locked, and m_start.
Referenced by ReadLock(), TryReadLock(), TryWriteLock(), and WriteLock().
|
protectedpure virtual |
Implemented in lldb_private::LockFilePosix, and lldb_private::LockFileWindows.
Referenced by ReadLock().
|
protectedpure virtual |
Implemented in lldb_private::LockFilePosix, and lldb_private::LockFileWindows.
Referenced by TryReadLock().
|
protectedpure virtual |
Implemented in lldb_private::LockFilePosix, and lldb_private::LockFileWindows.
Referenced by TryWriteLock().
|
protectedpure virtual |
Implemented in lldb_private::LockFilePosix, and lldb_private::LockFileWindows.
Referenced by Unlock().
|
protectedpure virtual |
Implemented in lldb_private::LockFilePosix, and lldb_private::LockFileWindows.
Referenced by WriteLock().
bool LockFileBase::IsLocked | ( | ) | const |
Definition at line 23 of file LockFileBase.cpp.
References m_locked.
|
protectedvirtual |
Reimplemented in lldb_private::LockFileWindows.
Definition at line 62 of file LockFileBase.cpp.
References m_fd.
Referenced by DoLock(), and lldb_private::LockFileWindows::IsValidFile().
Status LockFileBase::ReadLock | ( | const uint64_t | start, |
const uint64_t | len | ||
) |
Definition at line 37 of file LockFileBase.cpp.
References DoLock(), and DoReadLock().
Status LockFileBase::TryReadLock | ( | const uint64_t | start, |
const uint64_t | len | ||
) |
Definition at line 43 of file LockFileBase.cpp.
References DoLock(), and DoTryReadLock().
Status LockFileBase::TryWriteLock | ( | const uint64_t | start, |
const uint64_t | len | ||
) |
Definition at line 31 of file LockFileBase.cpp.
References DoLock(), and DoTryWriteLock().
Status LockFileBase::Unlock | ( | ) |
Definition at line 49 of file LockFileBase.cpp.
References DoUnlock(), error(), IsLocked(), m_len, m_locked, m_start, and NotLocked().
Referenced by lldb_private::LockFilePosix::~LockFilePosix(), and lldb_private::LockFileWindows::~LockFileWindows().
Status LockFileBase::WriteLock | ( | const uint64_t | start, |
const uint64_t | len | ||
) |
Definition at line 25 of file LockFileBase.cpp.
References DoLock(), and DoWriteLock().
|
protected |
|
protected |
Definition at line 52 of file LockFileBase.h.
Referenced by DoLock(), lldb_private::LockFilePosix::DoUnlock(), lldb_private::LockFileWindows::DoUnlock(), and Unlock().
|
protected |
Definition at line 50 of file LockFileBase.h.
Referenced by DoLock(), IsLocked(), and Unlock().
|
protected |
Definition at line 51 of file LockFileBase.h.
Referenced by DoLock(), lldb_private::LockFilePosix::DoUnlock(), and Unlock().