]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Wait takes now into account of name of the var.
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 11 Aug 2015 06:43:35 +0000 (08:43 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 11 Aug 2015 06:43:35 +0000 (08:43 +0200)
src/SALOMESDS/SALOMESDS_DataScopeServer.cxx
src/SALOMESDS/SALOMESDS_DataScopeServer.hxx
src/SALOMESDS/SALOMESDS_KeyWaiter.hxx
src/SALOMESDS/SALOMESDS_Transaction.cxx

index 514956e24dcd7898b0a51636046b82be68570c40..2b56d86d60581502cd246b4d2eeceb452899e79d 100644 (file)
@@ -561,7 +561,7 @@ void DataScopeServerTransaction::pingKey(PyObject *keyObj)
     }
 }
 
-void DataScopeServerTransaction::notifyKey(PyObject *keyObj, PyObject *valueObj)
+void DataScopeServerTransaction::notifyKey(const std::string& varName, PyObject *keyObj, PyObject *valueObj)
 {
   PyObject *cmpObj(getPyCmpFunc());
   if(!keyObj)
@@ -572,6 +572,11 @@ void DataScopeServerTransaction::notifyKey(PyObject *keyObj, PyObject *valueObj)
   std::list< KeyWaiter *> newList,listOfEltToWakeUp;
   for(std::list< KeyWaiter *>::iterator it=_waiting_keys.begin();it!=_waiting_keys.end();it++,ii++)
     {
+      if((*it)->getVarName()!=varName)
+        {
+          newList.push_back(*it);
+          continue;
+        }
       PyObject *waitKey((*it)->getKeyPyObj());
       PyTuple_SetItem(args,1,waitKey); Py_XINCREF(waitKey);
       PyObject *res(PyObject_CallObject(cmpObj,args));
index 608ae507ec47d5e57cc5f8594995ca1fe86e8224..9a98b8a905c060c474fa36b9645afbda2c2ad1c8 100644 (file)
@@ -124,7 +124,7 @@ namespace SALOMESDS
     PortableServer::POA_var getPOA4KeyWaiter() const { return _poa_for_key_waiter; }
     void addWaitKey(KeyWaiter *kw);
     void pingKey(PyObject *keyObj);
-    void notifyKey(PyObject *keyObj, PyObject *valueObj);
+    void notifyKey(const std::string& varName, PyObject *keyObj, PyObject *valueObj);
     SALOME::ByteVec *waitForMonoThrRev(SALOME::KeyWaiter_ptr kw);
   public://remotely callable
     char *getAccessOfVar(const char *varName);
index f16c72d7ff69bfd355efe0f45eaff4ea73501825..0bdd583ec92de6501aef999ad8acae65c9f036bb 100644 (file)
@@ -47,6 +47,7 @@ namespace SALOMESDS
     SALOME::ByteVec *waitFor();
     void valueJustCome(PyObject *val);
     void go();
+    std::string getVarName() const { return _var->getVarNameCpp(); }
     SALOME::ByteVec *waitForMonoThr();
   private:
     DataScopeServerTransaction *getDSS() const { return static_cast<DataScopeServerTransaction *>(_var->getFather()); }//thanks to dynamic_cast in constructor
index 463f2f5ffa25f5ddfd762300324d3217bfb8c78b..964303cfed5ef2ad774ba0a7da1fec48b3f1f2e7 100644 (file)
@@ -130,7 +130,7 @@ void TransactionAddKeyValue::prepareRollBackInCaseOfFailure()
 
 void TransactionAddKeyValue::notify()
 {
-  _dsct->notifyKey(_key,_value);
+  _dsct->notifyKey(getVarName(),_key,_value);
 }
 
 TransactionAddKeyValue::~TransactionAddKeyValue()