chai3d::cThread Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

chai3d::cThread::cThread ( )

Constructor of cThread.

chai3d::cThread::~cThread ( )
virtual

Destructor of cThread.

Member Function Documentation

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.

Parameters
a_functionPointer to thread function.
a_levelPriority 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.

Parameters
a_functionPointer to thread function.
a_levelPriority level of thread.
a_argFunction 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.

Parameters
a_levelPriority level of the thread.
CThreadPriority chai3d::cThread::getPriority ( ) const
inline

Member Data Documentation

DWORD chai3d::cThread::m_threadId
protected
void* chai3d::cThread::m_function
protected
CThreadPriority chai3d::cThread::m_priorityLevel
protected

The documentation for this class was generated from the following files: