Skip to content
Snippets Groups Projects
Commit 54642734 authored by Christoph Kampmeyer's avatar Christoph Kampmeyer
Browse files

TestableModeAccessorDecorator: Fix doPreRead

Lock is only released for accessors with wait_for_new_data on blocking
reads. This fixes usage of readLatest() in testable mode.
parent 7e0f4aa6
No related branches found
No related tags found
No related merge requests found
......@@ -113,14 +113,14 @@ namespace ChimeraTK {
if(Application::testableModeTestLock()) Application::testableModeUnlock("doReadTransfer " + this->getName());
}
/** Implement callback called by TransferFuture before it blocks in wait() */
// TODO Removed in TE spec. Call preRead isntead, see F.4 Still, has to
// handle multiple calls to preRead in readAny()
void doPreRead(TransferType type) override {
if(_handleRead) {
_target->preRead(type);
// Blocking reads have to release the lock so the data transport can happen
if(_handleRead && type == TransferType::read &&
TransferElement::_accessModeFlags.has(AccessMode::wait_for_new_data)) {
releaseLock();
}
_target->preRead(type);
}
/** Obtain the testableModeLock if not owned yet, and decrement the counter.
......
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