14 #ifndef GENERICTHREAD_H 15 #define GENERICTHREAD_H 26 typedef void ThreadFunc(
void *user_data);
28 GenericThread(
const std::string &name,
const std::string &sync_name);
29 GenericThread(
const std::string &name,
const std::string &sync_name, ThreadFunc *
function,
void *user_data);
31 INLINE
void set_function(ThreadFunc *
function);
32 INLINE ThreadFunc *get_function()
const;
34 INLINE
void set_user_data(
void *user_data);
35 INLINE
void *get_user_data()
const;
38 virtual void thread_main();
41 ThreadFunc *_function;
48 static void init_type() {
51 Thread::get_class_type());
54 return get_class_type();
56 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.