#include <Thread.h>
Public Member Functions | |
void | cancel () |
void | join () |
virtual void | run ()=0 |
void | setCancelSettings () |
void | start (const char *name=0) |
void | testCancel () |
virtual | ~Thread () |
Protected Attributes | |
TThread | m_Thread |
Encapsulates the platform-specific details of a thread.
Every thread of execution in an application is created by instantiating an object of a class derived from the Thread class. These classes must implement the run() method, which specifies the code of the thread.
You may store data local to the thread in the instances of the derived classes, but then you have to make sure, that the instance exists during the whole time of execution. In other words: Do not create local variables of a thread class!
Some error codes: ESRCH 3 EINVAL 22 EDEADLK 35 EAGAIN 11 e.g. when the is "sleep"ing!
virtual Thread::~Thread | ( | ) | [inline, virtual] |
void Thread::cancel | ( | ) |
Stops the threads.
Definition at line 60 of file Thread.cpp.
void Thread::join | ( | ) |
Wait for the thread to terminate.
Definition at line 102 of file Thread.cpp.
virtual void Thread::run | ( | ) | [pure virtual] |
Code to execute in a new thread. Derived classes have to override this method to specify the code that will be executed in a new thread.
void Thread::setCancelSettings | ( | ) |
Sets the cancel settings of the thread.
Definition at line 114 of file Thread.cpp.
void Thread::start | ( | const char * | name = 0 | ) |
Start the execution of the thread. This method spawns a new thread which executes the run() method of the instance.
Definition at line 38 of file Thread.cpp.
void Thread::testCancel | ( | ) |
Test, if the thread was canceled.
Definition at line 121 of file Thread.cpp.
TThread Thread::m_Thread [protected] |