14 #ifndef PYTHONTHREAD_H 15 #define PYTHONTHREAD_H 27 class PythonThread :
public Thread {
29 explicit PythonThread(PyObject *
function, PyObject *args,
30 const std::string &name,
const std::string &sync_name);
31 virtual ~PythonThread();
33 BLOCKING PyObject *
join();
36 PyObject *get_args()
const;
37 void set_args(PyObject *);
39 static PyObject *call_python_func(PyObject *
function, PyObject *args);
42 MAKE_PROPERTY(args, get_args, set_args);
45 virtual void thread_main();
56 static void init_type() {
59 Thread::get_class_type());
62 return get_class_type();
64 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.
void join()
Blocks the calling process until the thread terminates.
A thread; that is, a lightweight process.
TypeHandle is the identifier used to differentiate C++ class types.