#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.
|
| |
| bool | join () |
| | Block until the thread stops running.
|
| |
| bool | checkForStop () |
| |
| virtual void | run (void *arg=0) |
| |
| bool | isAlive () |
| | Returns true if the thread is running.
|
| |
| ThreadIdent | getId () |
| | Returns the platform specific thread id for this thread.
|
| |
|
| bool | autoDelete |
| | If set, the thread will delete itself once it has finished running.
|
| |
◆ Thread()
| 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. |
◆ ~Thread()
Destroy a thread. The thread MUST be allowed to exit before it is destroyed.
◆ checkForStop()
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.
◆ getId()
Returns the platform specific thread id for this thread.
◆ isAlive()
Returns true if the thread is running.
◆ join()
Block until the thread stops running.
◆ run()
| 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.
Reimplemented in ExecuteThread.
◆ start()
Start a thread. Sets shouldStop to false and calls run() in a new thread of execution.
◆ stop()
Ask a thread to stop running.
◆ autoDelete
If set, the thread will delete itself once it has finished running.
◆ mData
◆ shouldStop
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 files:
- platform/threads/thread.h
- platformAndroid/AndroidThread.cpp
- platformEmscripten/EmscriptenThread.cpp