From 68415853b5040733ff9f5d2739dd1bc704769bd1 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 28 Feb 2021 14:41:43 +0100 Subject: [PATCH] read commit IF functions protected again --- datapool/PoolDataSetBase.cpp | 5 ++++- datapool/ReadCommitIF.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/datapool/PoolDataSetBase.cpp b/datapool/PoolDataSetBase.cpp index 88470152..e7572b27 100644 --- a/datapool/PoolDataSetBase.cpp +++ b/datapool/PoolDataSetBase.cpp @@ -93,6 +93,7 @@ ReturnValue_t PoolDataSetBase::readVariable(uint16_t count) { mutexTimeoutForSingleVars); } else { + /* The readWithoutLock function is protected, so we use the attorney here */ result = ReadCommitIFAttorney::readWithoutLock(registeredVariables[count]); } @@ -125,6 +126,7 @@ void PoolDataSetBase::handleAlreadyReadDatasetCommit( mutexTimeoutForSingleVars); } else { + /* The commitWithoutLock function is protected, so we use the attorney here */ ReadCommitIFAttorney::commitWithoutLock(registeredVariables[count]); } } @@ -145,7 +147,8 @@ ReturnValue_t PoolDataSetBase::handleUnreadDatasetCommit( mutexTimeoutForSingleVars); } else { - result = registeredVariables[count]->commitWithoutLock(); + /* The commitWithoutLock function is protected, so we use the attorney here */ + ReadCommitIFAttorney::commitWithoutLock(registeredVariables[count]); } } else if (registeredVariables[count]->getDataPoolId() diff --git a/datapool/ReadCommitIF.h b/datapool/ReadCommitIF.h index d8bc5a66..3ad2b3c0 100644 --- a/datapool/ReadCommitIF.h +++ b/datapool/ReadCommitIF.h @@ -17,7 +17,7 @@ public: virtual ReturnValue_t commit(MutexIF::TimeoutType timeoutType, uint32_t timeoutMs) = 0; -public: +protected: /* Optional and protected because this is interesting for classes grouping members with commit and read semantics where the lock is only necessary once. */