#include <stthread.h>
Inheritance diagram for StThread:
Public Member Functions | |
StThread () | |
virtual | ~StThread () |
void | start () |
void | terminate () |
bool | hasFinished () const |
Protected Member Functions | |
virtual void | run ()=0 |
Private Member Functions | |
void | init () |
Static Private Member Functions | |
static void * | startThread (void *) |
Private Attributes | |
pthread_t | thread |
volatile bool | finished |
To create thread, just implement this class in yours and write down your own run() function. This will be code executed in your thread.
To run thread use start() function.
StThread::StThread | ( | ) |
virtual StThread::~StThread | ( | ) | [inline, virtual] |
bool StThread::hasFinished | ( | ) | const [inline] |
void StThread::init | ( | ) | [inline, private] |
Reimplemented in StApplication, and StUrl.
virtual void StThread::run | ( | ) | [protected, pure virtual] |
You must implement this function to make StThread work. Inside should be code that will be executed in thread.
Implemented in StApplication, and StUrl.
void StThread::start | ( | ) |
Run the thread.
void * StThread::startThread | ( | void * | ) | [static, private] |
void StThread::terminate | ( | ) |
Terminate the thread immediately.
volatile bool StThread::finished [private] |
pthread_t StThread::thread [private] |