Public Member Functions
|Constructor. Does not start the thread. |
|Destructor. If the thread is running, it will be stopped. |
|virtual void||threadFunc ()=0|
Static Public Member Functions
|static void *||run (void *arg)|
You'll probably find plenty of reading material on multithreaded programming on the internet.
The main advantage of this class over other multithreading APIs is that libProcTer uses it, so by using this class, you are 100% sure your threads are compatible with libProcTer threads. Also, it makes your multithreading code portable to all platforms supported by libProcTer.
If you still want to use another threading API: libProcter uses standard win32 threads on windows, and POSIX threads on all other platforms.
Constructor. Does not start the thread.
Destructor. If the thread is running, it will be stopped.
Assigns a low priority to the thread. This is only possible when the thread is running.
Starts the thread. Returns false on failure.
Stops the thread. Returns false on failure. This function blocks until the thread finishes voluntarily.
|virtual void libProcTer::CThread::threadFunc||(||)||
The main function of the thread. You should implement this method in your derived classes.
The thread stops when this function returns.
You can return whenever you want, but you should return as soon as m_Terminate becomes true. Therefore, your implementation of threadFunc should check the value of m_Terminate at regular intervals, and return as soon as it becomes true.
Indicates whether the thread should stop. threadFunc() should check this value at regular intervals, and return when it becomes true.