Definition at line 73 of file osbthread.h.
OSB_APP::ThreadBase::ThreadBase | ( | int | id = 0 |
) |
Default constructor with optional user defined id.
virtual OSB_APP::ThreadBase::~ThreadBase | ( | ) | [virtual] |
Virtual destructor.
void OSB_APP::ThreadBase::hasReturned | ( | ) | [private] |
Set running_ to false.
virtual int OSB_APP::ThreadBase::join | ( | bool | doStop, | |
int | signum = 0 | |||
) | [virtual] |
Join the thread, possibly stopping it.
doStop | Flag to stop the thread. | |
signum | Signal number to send, see below. |
If doStop is true the function
Afterwards pthread_join() is called.
int OSB_APP::ThreadBase::lock | ( | ) | const [protected] |
Lock the mutex.
void OSB_APP::ThreadBase::rc | ( | int | ret | ) | [protected] |
Set the return value.
int OSB_APP::ThreadBase::rc | ( | ) | const |
Return value of the thread.
bool OSB_APP::ThreadBase::running | ( | ) | const |
Thread (still) running?
virtual int OSB_APP::ThreadBase::start | ( | ) | [virtual] |
Start the thread via callThreadFunction.
int OSB_APP::ThreadBase::stop | ( | int | newStop | ) |
Set stop flag.
int OSB_APP::ThreadBase::stop | ( | ) | const |
Get stop flag.
virtual void OSB_APP::ThreadBase::threadFunction | ( | ) | [protected, pure virtual] |
int OSB_APP::ThreadBase::unlock | ( | ) | const [protected] |
Unlock the mutex.
void* callThreadFunction | ( | void * | threadBase | ) | [friend] |
Wrapper to ThreadBase::threadFunction.
Its signature must meet the requirement of pthread_create(...), i.e. we have to avoid the implicit this pointer that is added to non-static member functions.
threadBase | Pointer to the instance of ThreadBase for which ThreadBase::start() was called (its this pointer). |
pthread_mutex_t OSB_APP::ThreadBase::mutex_ [mutable, protected] |
int OSB_APP::ThreadBase::rc_ [protected] |
bool OSB_APP::ThreadBase::running_ [private] |
Flag if the thread is (still) running.
This flag is set to true in start() and set to false in callThreadFunction() after threadFunction() has returned.
Definition at line 159 of file osbthread.h.
int OSB_APP::ThreadBase::stop_ [protected] |
pthread_t OSB_APP::ThreadBase::thread_ [protected] |