From: Anthony Geay Date: Tue, 11 Aug 2015 06:43:35 +0000 (+0200) Subject: Wait takes now into account of name of the var. X-Git-Tag: V7_7_0a1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a04ec77e157438f33f6cac8c29c8b58ff6d9a251;p=modules%2Fkernel.git Wait takes now into account of name of the var. --- diff --git a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx index 514956e24..2b56d86d6 100644 --- a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx +++ b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx @@ -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)); diff --git a/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx b/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx index 608ae507e..9a98b8a90 100644 --- a/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx +++ b/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx @@ -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); diff --git a/src/SALOMESDS/SALOMESDS_KeyWaiter.hxx b/src/SALOMESDS/SALOMESDS_KeyWaiter.hxx index f16c72d7f..0bdd583ec 100644 --- a/src/SALOMESDS/SALOMESDS_KeyWaiter.hxx +++ b/src/SALOMESDS/SALOMESDS_KeyWaiter.hxx @@ -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(_var->getFather()); }//thanks to dynamic_cast in constructor diff --git a/src/SALOMESDS/SALOMESDS_Transaction.cxx b/src/SALOMESDS/SALOMESDS_Transaction.cxx index 463f2f5ff..964303cfe 100644 --- a/src/SALOMESDS/SALOMESDS_Transaction.cxx +++ b/src/SALOMESDS/SALOMESDS_Transaction.cxx @@ -130,7 +130,7 @@ void TransactionAddKeyValue::prepareRollBackInCaseOfFailure() void TransactionAddKeyValue::notify() { - _dsct->notifyKey(_key,_value); + _dsct->notifyKey(getVarName(),_key,_value); } TransactionAddKeyValue::~TransactionAddKeyValue()