15 #ifndef GENERICTHREAD_H
16 #define GENERICTHREAD_H
18 #include "pandabase.h"
28 typedef void ThreadFunc(
void *user_data);
31 GenericThread(
const string &name,
const string &sync_name, ThreadFunc *
function,
void *user_data);
33 INLINE
void set_function(ThreadFunc *
function);
34 INLINE ThreadFunc *get_function()
const;
36 INLINE
void set_user_data(
void *user_data);
37 INLINE
void *get_user_data()
const;
40 virtual void thread_main();
43 ThreadFunc *_function;
50 static void init_type() {
52 register_type(_type_handle,
"GenericThread",
53 Thread::get_class_type());
56 return get_class_type();
58 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
64 #include "genericThread.I"
A generic thread type that allows calling a C-style thread function without having to subclass...
A thread; that is, a lightweight process.
TypeHandle is the identifier used to differentiate C++ class types.