Salome HOME
projects
/
modules
/
yacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8efd29
)
Protect python calls with GIL
author
Anthony Geay
<anthony.geay@edf.fr>
Wed, 6 Apr 2016 11:54:32 +0000
(13:54 +0200)
committer
Anthony Geay
<anthony.geay@edf.fr>
Wed, 6 Apr 2016 11:54:32 +0000
(13:54 +0200)
src/evalyfx/YACSEvalSession.cxx
patch
|
blob
|
history
diff --git
a/src/evalyfx/YACSEvalSession.cxx
b/src/evalyfx/YACSEvalSession.cxx
index b4f1e2a5bf0fbc3cdb41084962f8ba2ecbc5d7e8..d28f8eb0b289b1e1a1c746021f4173fc732843d9 100644
(file)
--- a/
src/evalyfx/YACSEvalSession.cxx
+++ b/
src/evalyfx/YACSEvalSession.cxx
@@
-21,6
+21,7
@@
#include "YACSEvalSession.hxx"
#include "YACSEvalSessionInternal.hxx"
#include "YACSEvalSession.hxx"
#include "YACSEvalSessionInternal.hxx"
+#include "AutoGIL.hxx"
#include "Exception.hxx"
#include <Python.h>
#include "Exception.hxx"
#include <Python.h>
@@
-34,12
+35,16
@@
YACSEvalSession::YACSEvalSession():_isLaunched(false),_port(-1),_salomeInstanceM
if(!Py_IsInitialized())
Py_Initialize();
//
if(!Py_IsInitialized())
Py_Initialize();
//
- _salomeInstanceModule=PyImport_ImportModule(const_cast<char *>("salome_instance"));
+ {
+ YACS::ENGINE::AutoGIL gal;
+ _salomeInstanceModule=PyImport_ImportModule(const_cast<char *>("salome_instance"));
+ }
}
YACSEvalSession::~YACSEvalSession()
{
delete _internal;
}
YACSEvalSession::~YACSEvalSession()
{
delete _internal;
+ YACS::ENGINE::AutoGIL gal;
if(isLaunched())
{
PyObject *terminateSession(PyObject_GetAttrString(_salomeInstance,const_cast<char *>("stop")));//new
if(isLaunched())
{
PyObject *terminateSession(PyObject_GetAttrString(_salomeInstance,const_cast<char *>("stop")));//new
@@
-55,6
+60,7
@@
void YACSEvalSession::launch()
{
if(isLaunched())
return ;
{
if(isLaunched())
return ;
+ YACS::ENGINE::AutoGIL gal;
PyObject *salomeInstance(PyObject_GetAttrString(_salomeInstanceModule,const_cast<char *>("SalomeInstance")));//new
PyObject *startMeth(PyObject_GetAttrString(salomeInstance,const_cast<char *>("start")));
Py_XDECREF(salomeInstance);
PyObject *salomeInstance(PyObject_GetAttrString(_salomeInstanceModule,const_cast<char *>("SalomeInstance")));//new
PyObject *startMeth(PyObject_GetAttrString(salomeInstance,const_cast<char *>("start")));
Py_XDECREF(salomeInstance);
@@
-103,6
+109,7
@@
std::string YACSEvalSession::getCorbaConfigFileName() const
std::string YACSEvalSession::GetPathToAdd()
{
std::string ret;
std::string YACSEvalSession::GetPathToAdd()
{
std::string ret;
+ YACS::ENGINE::AutoGIL gal;
PyObject *osPy(PyImport_ImportModule(const_cast<char *>("os")));//new
PyObject *kernelRootDir(0);// os.environ["KERNEL_ROOT_DIR"]
{
PyObject *osPy(PyImport_ImportModule(const_cast<char *>("os")));//new
PyObject *kernelRootDir(0);// os.environ["KERNEL_ROOT_DIR"]
{