Panda3D
|
A generic thread type that allows calling a C-style thread function without having to subclass. More...
#include "genericThread.h"
Public Types | |
typedef void | ThreadFunc (void *user_data) |
Public Member Functions | |
GenericThread (const string &name, const string &sync_name) | |
GenericThread (const string &name, const string &sync_name, ThreadFunc *function, void *user_data) | |
virtual TypeHandle | force_init_type () |
ThreadFunc * | get_function () const |
Returns the function that is called when the thread runs. | |
virtual TypeHandle | get_type () const |
void * | get_user_data () const |
Returns the void pointer that is passed to the thread function. | |
void | set_function (ThreadFunc *function) |
Replaces the function that is called when the thread runs. | |
void | set_user_data (void *user_data) |
Replaces the void pointer that is passed to the thread function. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
virtual void | thread_main () |
This is the thread's main execution function. |
A generic thread type that allows calling a C-style thread function without having to subclass.
Definition at line 26 of file genericThread.h.
GenericThread::ThreadFunc * GenericThread::get_function | ( | ) | const [inline] |
Returns the function that is called when the thread runs.
Definition at line 34 of file genericThread.I.
void * GenericThread::get_user_data | ( | ) | const [inline] |
Returns the void pointer that is passed to the thread function.
Definition at line 57 of file genericThread.I.
void GenericThread::set_function | ( | GenericThread::ThreadFunc * | function | ) | [inline] |
Replaces the function that is called when the thread runs.
Definition at line 23 of file genericThread.I.
void GenericThread::set_user_data | ( | void * | user_data | ) | [inline] |
Replaces the void pointer that is passed to the thread function.
This is any arbitrary pointer; the thread object does no processing on it.
Definition at line 46 of file genericThread.I.
void GenericThread::thread_main | ( | ) | [protected, virtual] |
This is the thread's main execution function.
Implements Thread.
Definition at line 52 of file genericThread.cxx.