38#include <snapdev/poison.h>
86 log << log_level_t::fatal
87 <<
"The Snap! thread runner named \""
89 <<
"\" is still marked as running when its object is being destroyed."
190 log << log_level_t::info
191 <<
"entering thread \""
238 log << log_level_t::info
239 <<
"leaving thread \""
244 <<
static_cast<int>(status)
Lock a mutex in an RAII manner.
virtual bool continue_running() const
Whether the thread should continue running.
virtual ~runner()
The destructor checks that the thread was stopped.
mutex f_mutex
The mutex of this thread.
runner(std::string const &name)
Initializes the runner.
std::string const f_name
The name of this thread.
virtual void enter()
Signal that the run() function is about to be entered.
thread * get_thread() const
Retrieve the thread controller linked to this runner.
std::string const & get_name() const
Retrieve the name of the runner.
virtual void leave(leave_status_t status)
Signal that the run() function has returned.
thread * f_thread
A pointer back to the owner ("parent") of this runner.
virtual bool is_ready() const
Check whether this thread runner is ready.
pid_t gettid() const
Get this runner thread identifier.
A thread object that ensures proper usage of system threads.
bool is_stopping() const
Check whether the thread was asked to stop.
pid_t get_thread_tid() const
Retrieve the thread identifier of this thread.
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.
leave_status_t
The exit status.
Thread Runner and Managers.