14#ifndef GENERICTHREAD_H
15#define GENERICTHREAD_H
24class EXPCL_PANDA_PIPELINE GenericThread :
public Thread {
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);
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();}
ThreadFunc * get_function() const
Returns 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.
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.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.