Inheritance diagram for lfc::Thread::
Public Types | |||
enum | State { stCreated, stRunning, stFinished, stInvalid } | ||
enum | Priority { priorityMin = pal::threads::priorityMin, priorityNormal = pal::threads::priorityNormal, priorityMax = pal::threads::priorityMax } | ||
thread priority. More... | |||
Public Methods | |||
Thread () throw () | |||
creates a Thread. More... | |||
virtual | ~Thread () throw () | ||
virtual void | start () | ||
starts the Thread that calls it
| |||
virtual void | destroy () | ||
kills and destroys the Thread that calls it
| |||
virtual void | cancel () | ||
schedules this thread for cancellation. More... | |||
virtual int | join () const | ||
puts this thread on hold and waits for the other threads to finish execution. More... | |||
virtual void | setPriority (Priority priority) | ||
virtual Priority | priority () const | ||
the current priority. More... | |||
virtual void | setAutoDelete (bool bAutoDelete) | ||
sets the auto delete flag. More... | |||
virtual State | state () const throw () | ||
the current state of the Thread. More... | |||
Static Public Methods | |||
void | yield () | ||
gives up temporarily to allow other threads to run
| |||
void | sleep (long miliseconds) | ||
gives up execution and waits miliseconds before resuming. More... | |||
Thread * | self () | ||
returns a pointer to self. More... | |||
void | exit (int exitCode=0) | ||
exits the program with exitCode returned to the system. More... | |||
void | testCancel (int exitCode=-1) | ||
checks the cancellation flag and if it's set cancels the Thread. More... | |||
list< Thread *> | threadsSnapshot () | ||
returns a list of pointers to Threads still in existence. More... | |||
Protected Methods | |||
virtual void | main ()=0 | ||
the most important method of Thread You must override this method in your class that you derive from Thread. Whatever you put in this method is what gets executed when you call Thread::start(). More... | |||
Static Protected Methods | |||
void | startRoutine (void *arg) | ||
helper function for starting the thread. More... | |||
Protected Attributes | |||
pal::threads::ThreadHandle | m_handle | ||
Priority | m_priority | ||
volatile State | m_state | ||
volatile bool | m_bCancel | ||
volatile int | m_exitCode | ||
volatile bool | m_bAutoDelete | ||
Mutex | m_mutex | ||
Static Protected Attributes | |||
Mutex | s_globalMutex | ||
CurrentThreadTLS | s_currentThreadTLS | ||
list< Thread *> | s_threadsList |
|
|
|
thread priority.
|
|
creates a Thread.
|
|
|
|
starts the Thread that calls it
|
|
kills and destroys the Thread that calls it
|
|
schedules this thread for cancellation.
|
|
puts this thread on hold and waits for the other threads to finish execution.
|
|
\bried sets the threads priority
|
|
the current priority.
|
|
sets the auto delete flag.
|
|
the current state of the Thread.
|
|
gives up temporarily to allow other threads to run
|
|
gives up execution and waits miliseconds before resuming.
|
|
returns a pointer to self.
|
|
exits the program with exitCode returned to the system.
|
|
checks the cancellation flag and if it's set cancels the Thread.
|
|
returns a list of pointers to Threads still in existence.
|
|
the most important method of Thread You must override this method in your class that you derive from Thread. Whatever you put in this method is what gets executed when you call Thread::start().
Reimplemented in lfc::CallbackThread, and lfc::TimerThread. |
|
helper function for starting the thread.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|