38#include <snapdev/poison.h>
92 throw logic_error(
"mutex missing in guard() constructor");
114 catch(std::exception
const & e)
117 log << log_level_t::fatal
118 <<
"mutex::unlock() threw an exception while in the ~guard() function."
238 bool result(
f_mutex !=
nullptr);
~guard()
Ensure that the mutex was unlocked.
bool is_locked() const
This function returns whether the guard is current locked.
void unlock(bool done=true)
Unlock this mutex.
void lock()
Relock this mutex.
mutex * f_mutex
The mutex used by the guard class.
bool f_locked
Whether the guard is currently in effect.
guard(mutex &m)
Lock a mutex.
A mutex object to ensures atomicity.
void unlock()
Unlock a mutex.
Exceptions for the thread environment.
Thread Runner and Managers.
logger log
The logger object used to send logs out.
Declaration of the log class used to send error messages.
logger & end(logger &l)
Close a log statement.
Thread Runner and Managers.