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

@ -89,6 +89,7 @@ public:
* @return
*/
virtual ReturnValue_t registerVariable( PoolVariableIF* variable) override;
/**
* Provides the means to lock the underlying data structure to ensure
* thread-safety. Default implementation is empty
@ -114,6 +115,15 @@ public:
SerializeIF::Endianness streamEndianness) override;
protected:
/**
* Can be used to individually protect every read and commit call.
* @param protectEveryReadCommit
* @param mutexTimeout
*/
void setReadCommitProtectionBehaviour(bool protectEveryReadCommit,
uint32_t mutexTimeout = 20);
/**
* @brief The fill_count attribute ensures that the variables
* register in the correct array position and that the maximum
@ -144,6 +154,9 @@ protected:
void setContainer(PoolVariableIF** variablesContainer);
private:
bool protectEveryReadCommitCall = false;
uint32_t mutexTimeout = 20;
ReturnValue_t readVariable(uint16_t count);
void handleAlreadyReadDatasetCommit(uint32_t lockTimeout);
ReturnValue_t handleUnreadDatasetCommit(uint32_t lockTimeout);