![]() |
Kea 3.1.3
|
RAII device to handle a lock file to avoid race conditions. More...
#include <pid_file.h>
Public Member Functions | |
PIDLock (const std::string &lockname, bool blocking=false) | |
Constructor. | |
~PIDLock () | |
Destructor. | |
bool | isLocked () |
Return the lock status. | |
RAII device to handle a lock file to avoid race conditions.
Definition at line 115 of file pid_file.h.
isc::util::PIDLock::PIDLock | ( | const std::string & | lockname, |
bool | blocking = false ) |
Constructor.
Try to get a lock.
lockname | Lock filename. |
blocking | If true (default is false) block when already locked. |
Definition at line 89 of file pid_file.cc.
References isc_throw.
isc::util::PIDLock::~PIDLock | ( | ) |
Destructor.
Release the lock when taken and delete the lock file.
Definition at line 117 of file pid_file.cc.
|
inline |
Return the lock status.
Definition at line 131 of file pid_file.h.
Referenced by isc::process::Daemon::createPIDFile(), isc::dhcp::LFCSetup::execute(), isc::dhcp::Memfile_LeaseMgr::isLFCProcessRunning(), and isc::lfc::LFCController::launch().