X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FContainer%2FContainer_init_python.hxx;h=75e484524af5579de6d8b694dafa25f0c504bc94;hb=f932433e7396f9be950f617c50c9b15db1a33be1;hp=0b9651651c70bed7727efc82f74e8d99da4f6295;hpb=63414a08d9492c25c206579c1953ec6f390679fd;p=modules%2Fyacs.git diff --git a/src/Container/Container_init_python.hxx b/src/Container/Container_init_python.hxx index 0b9651651..75e484524 100644 --- a/src/Container/Container_init_python.hxx +++ b/src/Container/Container_init_python.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -53,27 +53,14 @@ #define Py_ACQUIRE_NEW_THREAD \ - PyEval_AcquireLock(); \ - PyThreadState *myTstate = PyThreadState_New(KERNEL_PYTHON::_interp); \ - PyThreadState_Swap(myTstate); + PyGILState_STATE gil_state = PyGILState_Ensure(); #define Py_RELEASE_NEW_THREAD \ - PyEval_ReleaseThread(myTstate); \ - PyThreadState_Delete(myTstate); + PyGILState_Release(gil_state); struct CONTAINER_EXPORT KERNEL_PYTHON { -#ifdef WIN32 - static PyThreadState *get_gtstate() { return KERNEL_PYTHON::_gtstate; } - static PyObject *getsalome_shared_modules_module() { return KERNEL_PYTHON::salome_shared_modules_module; } - static PyInterpreterState *get_interp() { return KERNEL_PYTHON::_interp; } -#endif - static PyThreadState *_gtstate; - static PyObject *salome_shared_modules_module; - static PyInterpreterState *_interp; - static void init_python(int argc, char **argv); - }; #endif