Thread. More...
#include <deThread.h>
Public Member Functions | |
Constructors and Destructors | |
| deThread () | |
| Creates a thread. | |
| virtual | ~deThread () |
| Cleans the thread. | |
Management | |
| bool | IsRunning () |
| Determines if the thread is running. | |
| void | Start () |
| Starts the thread if not running already. | |
| void | Stop () |
| Stops the thread. | |
| void | WaitForExit () |
| Waits for the thread to end and then returns. | |
| virtual void | Run ()=0 |
| Run function of the thread. | |
Thread.
Runs a thread. Thin layer over the operating system thread support. Subclass to add your own run function.
| deThread::deThread | ( | ) |
Creates a thread.
| virtual deThread::~deThread | ( | ) | [virtual] |
Cleans the thread.
| bool deThread::IsRunning | ( | ) |
Determines if the thread is running.
| virtual void deThread::Run | ( | ) | [pure virtual] |
Run function of the thread.
Overwrite to implement what the threa is supposed to be doing. Once this function ends the thread is stopped.
Implemented in deResourceLoaderThread.
| void deThread::Start | ( | ) |
Starts the thread if not running already.
| void deThread::Stop | ( | ) |
Stops the thread.
Returns as soon as the thread stopped.
| void deThread::WaitForExit | ( | ) |
Waits for the thread to end and then returns.
This is the safe way to end a thread especially if mutices or semaphores are used. Make sure the thread ends soon or else this call deadlocks your application.
1.7.2