PyDict_SetItemString(_globals,"socket",socket);
}
+void SALOME_CPythonHelper::allowPythonCallsFromDifferentThread() const
+{
+#if PY_VERSION_HEX < 0x03070000
+ PyEval_InitThreads(); /* Create (and acquire) the interpreter lock (for threads)*/
+#endif
+ PyEval_SaveThread(); /* Release the thread state */
+}
+
void SALOME_CPythonHelper::registerToSalomePiDict(const std::string& processName, long pid) const
{
AutoGIL agil;
{
public:
void initializePython(int argc, char *argv[]);
+ void allowPythonCallsFromDifferentThread() const;
void registerToSalomePiDict(const std::string& processName, long pid) const;
std::vector<long> evalVL(const std::string& pyCode) const;
std::string evalS(const std::string& pyCode) const;
threadPol->destroy();
SALOME_CPythonHelper cPyh;
cPyh.initializePython(argc,argv);
+ cPyh.allowPythonCallsFromDifferentThread();
SALOME_Launcher *lServ(new SALOME_Launcher(orb,safePOA));
lServ->DeclareUsingSalomeSession();
lServ->_remove_ref();