#include <thread.h>
|
| Thread (ThreadRunFunction func=0, void *arg=0, bool start_thread=true, bool autodelete=false) |
|
virtual | ~Thread () |
|
void | start () |
|
void | stop () |
| Ask a thread to stop running. More...
|
|
bool | join () |
| Block until the thread stops running. More...
|
|
bool | checkForStop () |
|
virtual void | run (void *arg=0) |
|
bool | isAlive () |
| Returns true if the thread is running. More...
|
|
U32 | getId () |
| Returns the platform specific thread id for this thread. More...
|
|
|
bool | autoDelete |
| If set, the thread will delete itself once it has finished running. More...
|
|
Thread |
( |
ThreadRunFunction |
func = 0 , |
|
|
void * |
arg = 0 , |
|
|
bool |
start_thread = true , |
|
|
bool |
autodelete = false |
|
) |
| |
Create a thread.
- Parameters
-
func | The starting function for the thread. |
arg | Data to be passed to func, when the thread starts. |
start_thread | Whether to start the Thread immediately. |
Destroy a thread. The thread MUST be allowed to exit before it is destroyed.
Threads may call checkForStop() periodically to check if they've been asked to stop. As soon as checkForStop() returns true, the thread should clean up and return.
Returns the platform specific thread id for this thread.
Returns true if the thread is running.
Block until the thread stops running.
virtual void run |
( |
void * |
arg = 0 | ) |
|
|
virtual |
Run the Thread's entry point function. Override this method in a subclass of Thread to create threaded code in an object oriented way, and without passing a function ptr to Thread(). Also, you can call this method directly to execute the thread's code in a non-threaded way.
Start a thread. Sets shouldStop to false and calls run() in a new thread of execution.
Ask a thread to stop running.
If set, the thread will delete itself once it has finished running.
PlatformThreadData* mData |
|
protected |
Used to signal threads need to stop. Threads set this flag to false in start()
The documentation for this class was generated from the following file:
- platform/threads/thread.h