]> SALOME platform Git repositories - tools/adao_interface.git/commitdiff
Salome HOME
Reduce critical section
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 25 Sep 2019 08:17:27 +0000 (10:17 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 25 Sep 2019 08:17:27 +0000 (10:17 +0200)
AdaoExchangeLayer.cxx

index 9a101a4965c916b537297ea3060e53ddefc804dd..a478bf0d77c9edf152ff23b4d6b94de5c5915d56 100644 (file)
@@ -321,10 +321,12 @@ void AdaoExchangeLayer::loadTemplate(AdaoModel::MainModel *model)
 
 void ExecuteAsync(PyObject *pyExecuteFunction, DataExchangedBetweenThreads *data)
 {
-  AutoGIL gil; // launched in a separed thread -> protect python calls
-  PyObjectRAII args(PyObjectRAII::FromNew(PyTuple_New(0)));
-  PyObjectRAII nullRes(PyObjectRAII::FromNew(PyObject_CallObject(pyExecuteFunction,args)));// go to adaocallback_call
-  PyErr_Print();
+  {
+    AutoGIL gil; // launched in a separed thread -> protect python calls
+    PyObjectRAII args(PyObjectRAII::FromNew(PyTuple_New(0)));
+    PyObjectRAII nullRes(PyObjectRAII::FromNew(PyObject_CallObject(pyExecuteFunction,args)));// go to adaocallback_call
+    PyErr_Print();
+  }
   data->_finished = true;
   data->_data = nullptr;
   sem_post(&data->_sem);