This class implements support for threads. More...
#include <CThread.h>
Public Member Functions | |
cThread () | |
Constructor of cThread. More... | |
virtual | ~cThread () |
Destructor of cThread. More... | |
void | start (void(*a_function)(void), const CThreadPriority a_level) |
This method sets the thread parameters (and start it). More... | |
void | start (void(*a_function)(void *), const CThreadPriority a_level, void *a_arg) |
This method sets the thread parameters (and start it). More... | |
void | stop () |
This method terminates the thread (not recommended!). More... | |
void | setPriority (CThreadPriority a_level) |
This method sets the thread priority level. More... | |
CThreadPriority | getPriority () const |
This method returns the current thread priority level. More... | |
Protected Attributes | |
DWORD | m_threadId |
Thread handle. More... | |
void * | m_function |
Pointer to thread function. More... | |
CThreadPriority | m_priorityLevel |
Thread priority level. More... | |
A process can create one or more threads to execute a portion of the program code associated with the process. Use method start() to specify the program code executed by a thread. The method also allows you to pass data to the thread procedure.
A scheduling priority level, as defined in CThreadPriority, can be requested for a thread, but is not guaranteed to be honored by the operating system.
chai3d::cThread::cThread | ( | ) |
Constructor of cThread.
|
virtual |
Destructor of cThread.
void chai3d::cThread::start | ( | void(*)(void) | a_function, |
const CThreadPriority | a_level | ||
) |
This method creates a thread to execute within the address space of the calling process. Parameters include a pointer to the function and its priority level.
a_function | Pointer to thread function. |
a_level | Priority level of thread. |
void chai3d::cThread::start | ( | void(*)(void *) | a_function, |
const CThreadPriority | a_level, | ||
void * | a_arg | ||
) |
This method creates a thread to execute within the address space of the calling process. Parameters include a pointer to the function, its priority level, and arguments passed to the function.
a_function | Pointer to thread function. |
a_level | Priority level of thread. |
a_arg | Function arguments to pass when staring thread. |
void chai3d::cThread::stop | ( | ) |
This method terminates the thread (not recommended!).
void chai3d::cThread::setPriority | ( | CThreadPriority | a_level | ) |
This method adjusts the priority level of the thread.
a_level | Priority level of the thread. |
|
inline |
|
protected |
|
protected |
|
protected |