21 : m_fd(fd), m_locked(false), m_start(0), m_len(0) {}
26 return DoLock([&](
const uint64_t start,
27 const uint64_t len) {
return DoWriteLock(start, len); },
32 return DoLock([&](
const uint64_t start,
38 return DoLock([&](
const uint64_t start,
39 const uint64_t len) {
return DoReadLock(start, len); },
44 return DoLock([&](
const uint64_t start,
54 if (
error.Success()) {
73 if (
error.Success()) {
static llvm::raw_ostream & error(Stream &strm)
static Status AlreadyLocked()
static Status NotLocked()
std::function< Status(const uint64_t, const uint64_t)> Locker
virtual bool IsValidFile() const
Status TryWriteLock(const uint64_t start, const uint64_t len)
virtual Status DoTryReadLock(const uint64_t start, const uint64_t len)=0
Status WriteLock(const uint64_t start, const uint64_t len)
Status TryReadLock(const uint64_t start, const uint64_t len)
virtual Status DoTryWriteLock(const uint64_t start, const uint64_t len)=0
Status ReadLock(const uint64_t start, const uint64_t len)
Status DoLock(const Locker &locker, const uint64_t start, const uint64_t len)
virtual Status DoUnlock()=0
virtual Status DoWriteLock(const uint64_t start, const uint64_t len)=0
virtual Status DoReadLock(const uint64_t start, const uint64_t len)=0
static Status FromErrorString(const char *str)
A class that represents a running process on the host machine.