Skip to content
Snippets Groups Projects
Commit 6bf6b49a authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

fix not obeying hasNewData flag in two places

parent 1db27c25
No related branches found
No related tags found
No related merge requests found
......@@ -128,6 +128,7 @@ namespace ChimeraTK {
assert(_hasReturnSlave);
auto _ = cppext::finally([&] {
if(!hasNewData) return;
_returnSlave->accessChannel(0).swap(ChimeraTK::NDRegisterAccessor<UserType>::buffer_2D[0]);
// distribute return-channel update to the other slaves
for(auto& slave : FanOut<UserType>::slaves) { // send out copies to slaves
......
......@@ -118,8 +118,9 @@ namespace ChimeraTK {
/** Obtain the testableModeLock if not owned yet, and decrement the counter.
*/
void obtainLockAndDecrementCounter() {
void obtainLockAndDecrementCounter(bool hasNewData) {
if(!Application::testableModeTestLock()) Application::testableModeLock("doReadTransfer " + this->getName());
if(!hasNewData) return;
if(Application::getInstance().testableMode_perVarCounter[_variableIdRead] > 0) {
assert(Application::getInstance().testableMode_counter > 0);
--Application::getInstance().testableMode_counter;
......@@ -147,7 +148,7 @@ namespace ChimeraTK {
/** Obtain the testableModeLock if not owned yet, decrement the counter, and
* release the lock again. */
void decrementCounter() {
obtainLockAndDecrementCounter();
obtainLockAndDecrementCounter(true);
releaseLock();
}
......@@ -176,7 +177,7 @@ namespace ChimeraTK {
}
void doPostRead(TransferType type, bool hasNewData) override {
if(_handleRead) obtainLockAndDecrementCounter();
if(_handleRead) obtainLockAndDecrementCounter(hasNewData);
ChimeraTK::NDRegisterAccessorDecorator<UserType>::doPostRead(type, hasNewData);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment