From 47ea178aa05d1c41765b7da1b2df6009348b2ece Mon Sep 17 00:00:00 2001 From: abd Date: Fri, 31 Mar 2006 10:37:00 +0000 Subject: [PATCH] Update executive version Temprorary fix python of calls --- src/Container/Container_i.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 82f63facd..a35b806c0 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -173,12 +173,20 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, if (!_isSupervContainer) { - Py_ACQUIRE_NEW_THREAD; + //Py_ACQUIRE_NEW_THREAD; + PyEval_AcquireLock(); + /* It should not be possible for more than one thread state + to be used for a thread.*/ + PyThreadState *myTstate = PyGILState_GetThisThreadState(); + // if no thread state defined + if ( !myTstate ) myTstate = PyThreadState_New(KERNEL_PYTHON::_interp); + PyThreadState *myoldTstate = PyThreadState_Swap(myTstate); #ifdef WNT // mpv: this is temporary solution: there is a unregular crash if not - Sleep(2000); - PyRun_SimpleString("import sys\n"); - // first element is the path to Registry.dll, but it's wrong + //Sleep(2000); + // + // first element is the path to Registry.dll, but it's wrong + PyRun_SimpleString("import sys\n"); PyRun_SimpleString("sys.path = sys.path[1:]\n"); #endif PyRun_SimpleString("import SALOME_Container\n"); -- 2.39.2