1
0
forked from fsfw/fsfw

its possible to protect every read/commit now

This commit is contained in:
2020-12-26 23:57:23 +01:00
parent e35c2cd604
commit 76696e34be
4 changed files with 61 additions and 6 deletions

View File

@ -54,7 +54,7 @@ public:
*/
LocalPoolDataSetBase(HasLocalDataPoolIF *hkOwner,
uint32_t setId, PoolVariableIF** registeredVariablesArray,
const size_t maxNumberOfVariables, bool noPeriodicHandling = false);
const size_t maxNumberOfVariables, bool periodicHandling = true);
/**
* @brief Constructor for users of local pool data.
@ -77,6 +77,16 @@ public:
*/
~LocalPoolDataSetBase();
/**
* If the data is pulled from different local data pools, every read and
* commit call should be mutex protected for thread safety.
* This can be specified with the second parameter.
* @param dataCreator
* @param protectEveryReadCommit
*/
void setReadCommitProtectionBehaviour(bool protectEveryReadCommit,
uint32_t mutexTimeout = 20);
void setValidityBufferGeneration(bool withValidityBuffer);
sid_t getSid() const;
@ -128,6 +138,7 @@ public:
protected:
sid_t sid;
uint32_t mutexTimeout = 20;
MutexIF* mutex = nullptr;
bool diagnostic = false;