Stefan Sayer wrote:
Hello,
in Ivr, there is this initialization of the python interpreter:
void IvrFactory::init_python_interpreter(const string& script_path)
{
if(!Py_IsInitialized()){
add_env_path("PYTHONPATH",AmConfig::PlugInPath);
Py_Initialize();
}
PyEval_InitThreads();
set_sys_path(script_path);
import_ivr_builtins();
PyEval_SaveThread();
}
PyEval_InitThreads() acquires the GIL, and I suppose
PyEval_SaveThread() is there to release the GIL - but it also sets the
interpreter thread state to NULL and returns the current interpreter
thread state (http://www.python.org/doc/2.5.2/api/threads.html).
Should this not be simply PyEval_ReleaseLock() instead?
Nope! This is how it was before, and it crashed/blocked just as you
described before. I read this in some bug report about the GIL. At least
it solved the problem I had at that time.
-Raphael.
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev