24#ifndef LIBTHREADAR_THREAD_HPP
25#define LIBTHREADAR_THREAD_HPP
185 cancel_except(cancel_except &) =
default;
186 cancel_except(cancel_except &&)
noexcept =
default;
187 cancel_except & operator = (cancel_except &) =
default;
188 cancel_except & operator = (cancel_except &&)
noexcept =
default;
189 ~cancel_except() =
default;
254 mutable mutex field_control;
258 mutable bool do_cancel;
260 unsigned int stack_size;
268 static void *run_obj(
void *obj);
Wrapper around the Posix pthread_mutex_t C objects.
bool is_running() const
checks whether a separated thread is running the inherited_run() method of this object
void reset_stack_size()
reset the stack size to the system default value
void cancellation_checkpoint() const
available withing the inherited_run() method to eventually trigger thread cancellation
virtual void set_signal_mask(const sigset_t &mask)
set signal mask of the thread spawn by run()
void run()
launch the current object routing in a separated thread
virtual void inherited_cancel()
unsigned int get_stack_size() const
get the current stack size value
void cancel()
the caller send a cancellation request to this object's running thread if any
virtual void inherited_run()=0
action to be performed in the separated thread (implementation is expected in inherited classes)
bool is_running(pthread_t &id) const
checks whether the object is running in a separated thread
thread(const thread &ref)=delete
copy constructor and assignment operator are disabled
void set_stack_size(unsigned int val)
set the stack size to non default value
virtual ~thread()
destructor
void join() const
the caller will be suspended until the current object's thread ends
defines the mutex C++ class
This is the only namespace used in libthreadar and all symbols provided by libthreadar are member of ...