mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
track_in_interpreter
This commit is contained in:
parent
7d12427481
commit
137998a5c7
@ -2274,13 +2274,16 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface
|
||||
if (!remap->_void_return &&
|
||||
remap->_return_type->new_type_is_atomic_string()) {
|
||||
// Treat strings as a special case. We don't want to format the
|
||||
// return expression.
|
||||
// return expression.
|
||||
if (remap->_blocking) {
|
||||
indent(out, extra_indent_level)
|
||||
<< "PyThreadState *_save;\n";
|
||||
indent(out, extra_indent_level)
|
||||
<< "Py_UNBLOCK_THREADS\n";
|
||||
}
|
||||
if (track_interpreter) {
|
||||
indent(out,extra_indent_level) << "in_interpreter = 0;\n";
|
||||
}
|
||||
string tt;
|
||||
string return_expr = remap->call_function(out, extra_indent_level, false, container, pexprs);
|
||||
CPPType *type = remap->_return_type->get_orig_type();
|
||||
@ -2289,14 +2292,13 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface
|
||||
// type->output_instance(tt, "return_value", &parser);
|
||||
out << " = " << return_expr << ";\n";
|
||||
|
||||
if (track_interpreter) {
|
||||
indent(out,extra_indent_level) << "in_interpreter = 1;\n";
|
||||
}
|
||||
if (remap->_blocking) {
|
||||
indent(out, extra_indent_level)
|
||||
<< "Py_BLOCK_THREADS\n";
|
||||
}
|
||||
|
||||
if (track_interpreter) {
|
||||
indent(out,extra_indent_level) << "in_interpreter = 1;\n";
|
||||
}
|
||||
if (!extra_cleanup.empty()) {
|
||||
indent(out,extra_indent_level) << extra_cleanup << "\n";
|
||||
}
|
||||
@ -2312,17 +2314,19 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface
|
||||
indent(out, extra_indent_level)
|
||||
<< "Py_UNBLOCK_THREADS\n";
|
||||
}
|
||||
if (track_interpreter) {
|
||||
indent(out,extra_indent_level) << "in_interpreter = 0;\n";
|
||||
}
|
||||
|
||||
string return_expr = remap->call_function(out, extra_indent_level, true, container, pexprs);
|
||||
if (return_expr.empty()) {
|
||||
if (track_interpreter) {
|
||||
indent(out,extra_indent_level) << "in_interpreter = 1;\n";
|
||||
}
|
||||
if (remap->_blocking) {
|
||||
indent(out, extra_indent_level)
|
||||
<< "Py_BLOCK_THREADS\n";
|
||||
}
|
||||
|
||||
if (track_interpreter) {
|
||||
indent(out,extra_indent_level) << "in_interpreter = 1;\n";
|
||||
}
|
||||
if (!extra_cleanup.empty()) {
|
||||
indent(out,extra_indent_level) << extra_cleanup << "\n";
|
||||
}
|
||||
@ -2336,14 +2340,13 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface
|
||||
type->output_instance(out, "return_value", &parser);
|
||||
out << " = " << return_expr << ";\n";
|
||||
}
|
||||
if (track_interpreter) {
|
||||
indent(out,extra_indent_level) << "in_interpreter = 1;\n";
|
||||
}
|
||||
if (remap->_blocking) {
|
||||
indent(out, extra_indent_level)
|
||||
<< "Py_BLOCK_THREADS\n";
|
||||
}
|
||||
|
||||
if (track_interpreter) {
|
||||
indent(out,extra_indent_level) << "in_interpreter = 1;\n";
|
||||
}
|
||||
if (!extra_cleanup.empty()) {
|
||||
indent(out,extra_indent_level) << extra_cleanup << "\n";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user