libstorage-ng
|
Exception indicating that getting the lock failed. More...
#include <Lock.h>
Public Member Functions | |
LockException (pid_t locker_pid) | |
pid_t | get_locker_pid () const |
pid of one of the process holding a lock. More... | |
![]() | |
Exception (LogLevel log_level=LogLevel::ERROR) | |
Default constructor. More... | |
Exception (const std::string &msg, LogLevel log_level=LogLevel::ERROR) | |
Constructor taking a message. More... | |
virtual | ~Exception () noexcept |
Destructor. | |
const CodeLocation & | where () const |
Return CodeLocation. | |
void | relocate (const CodeLocation &newLocation) const |
Exchange location on rethrow. | |
const std::string & | msg () const |
Return the message string provided to the constructor. More... | |
LogLevel | log_level () const |
void | setMsg (const std::string &msg) |
Set a new message string. | |
std::string | asString () const |
Error message provided by dumpOn as string. | |
virtual const char * | what () const noexcept override |
Return message string. More... | |
Additional Inherited Members | |
![]() | |
static std::string | strErrno (int errno_r) |
Make a string from errno_r. | |
static std::string | strErrno (int errno_r, const std::string &msg) |
Make a string from errno_r and msg_r. | |
static void | log (const Exception &exception, const CodeLocation &location, const char *const prefix) |
Drop a log line on throw, catch or rethrow. More... | |
![]() | |
virtual std::ostream & | dumpOn (std::ostream &str) const |
Overload this to print a proper error message. | |
Exception indicating that getting the lock failed.
pid_t storage::LockException::get_locker_pid | ( | ) | const |
pid of one of the process holding a lock.
The pid is 0 if it could not be determined, -1 if the lock is held by a open file descriptor lock and -2 if the lock is held by the same process. Note that the pid may already be out of date by the time the function returns.