30 return mode_ != Mode::Unlocked;
38 std::string lock_path_;
39 enum class Mode : std::uint8_t { Unlocked, Shared, Exclusive };
40 Mode mode_ = Mode::Unlocked;
42 void* handle_ =
nullptr;
bool is_locked() const
Whether this instance holds the lock.
Definition inter_process_lock.hpp:29
void unlock()
Release the lock.
bool try_lock_shared()
Try to acquire a shared/read lock. Multiple shared holders may coexist.
bool try_lock()
Try to acquire the lock. Returns true if acquired.
InterProcessLock & operator=(const InterProcessLock &)=delete
InterProcessLock(const InterProcessLock &)=delete
InterProcessLock(std::string_view name)
Create a lock with the given name (used to derive the lock file path).
Definition generated_event_source.hpp:33