datapoolglob update
This commit is contained in:
@ -12,8 +12,40 @@ inline GlobPoolVector<T, vectorSize>::GlobPoolVector(uint32_t set_id,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename T, uint16_t vectorSize>
|
||||
inline ReturnValue_t GlobPoolVector<T, vectorSize>::read() {
|
||||
inline ReturnValue_t GlobPoolVector<T, vectorSize>::read(uint32_t lockTimeout) {
|
||||
ReturnValue_t result = glob::dataPool.lockDataPool(lockTimeout);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = readWithoutLock();
|
||||
ReturnValue_t unlockResult = glob::dataPool.unlockDataPool();
|
||||
if(unlockResult != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "GlobPoolVar::read: Could not unlock global data pool"
|
||||
<< std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T, uint16_t vectorSize>
|
||||
inline ReturnValue_t GlobPoolVector<T, vectorSize>::commit(
|
||||
uint32_t lockTimeout) {
|
||||
ReturnValue_t result = glob::dataPool.lockDataPool(lockTimeout);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = commitWithoutLock();
|
||||
ReturnValue_t unlockResult = glob::dataPool.unlockDataPool();
|
||||
if(unlockResult != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "GlobPoolVar::read: Could not unlock global data pool"
|
||||
<< std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
template<typename T, uint16_t vectorSize>
|
||||
inline ReturnValue_t GlobPoolVector<T, vectorSize>::readWithoutLock() {
|
||||
PoolEntry<T>* read_out = glob::dataPool.getData<T>(this->dataPoolId,
|
||||
vectorSize);
|
||||
if (read_out != nullptr) {
|
||||
@ -33,7 +65,7 @@ inline ReturnValue_t GlobPoolVector<T, vectorSize>::read() {
|
||||
}
|
||||
|
||||
template<typename T, uint16_t vectorSize>
|
||||
inline ReturnValue_t GlobPoolVector<T, vectorSize>::commit() {
|
||||
inline ReturnValue_t GlobPoolVector<T, vectorSize>::commitWithoutLock() {
|
||||
PoolEntry<T>* writeBack = glob::dataPool.getData<T>(this->dataPoolId,
|
||||
vectorSize);
|
||||
if ((writeBack != nullptr) && (this->readWriteMode != VAR_READ)) {
|
||||
|
Reference in New Issue
Block a user