replaced all chained locks
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
parent
1d12d5f144
commit
5f9a52977b
@ -23,8 +23,8 @@ ReturnValue_t SensorValues::updateMgm() {
|
|||||||
std::vector<ReturnValue_t> results;
|
std::vector<ReturnValue_t> results;
|
||||||
|
|
||||||
{
|
{
|
||||||
PoolReadGuard pgMgm0(&mgm0Lis3Set);
|
PoolReadGuard pgMgm(&mgm0Lis3Set);
|
||||||
results.push_back(pgMgm0.getReadResult());
|
results.push_back(pgMgm.getReadResult());
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
PoolReadGuard pgMgm(&mgm1Rm3100Set);
|
PoolReadGuard pgMgm(&mgm1Rm3100Set);
|
||||||
@ -51,31 +51,49 @@ ReturnValue_t SensorValues::updateMgm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SensorValues::updateSus() {
|
ReturnValue_t SensorValues::updateSus() {
|
||||||
ReturnValue_t result;
|
std::vector<ReturnValue_t> results;
|
||||||
PoolReadGuard pgSus0(&susSets[0]), pgSus1(&susSets[1]), pgSus2(&susSets[2]), pgSus3(&susSets[3]),
|
for (auto& susSet : susSets) {
|
||||||
pgSus4(&susSets[4]), pgSus5(&susSets[5]), pgSus6(&susSets[6]), pgSus7(&susSets[7]),
|
{
|
||||||
pgSus8(&susSets[8]), pgSus9(&susSets[9]), pgSus10(&susSets[10]), pgSus11(&susSets[11]);
|
PoolReadGuard pgSus(&susSet);
|
||||||
|
results.push_back(pgSus.getReadResult());
|
||||||
result = (pgSus0.getReadResult() || pgSus1.getReadResult() || pgSus2.getReadResult() ||
|
}
|
||||||
pgSus3.getReadResult() || pgSus4.getReadResult() || pgSus5.getReadResult() ||
|
}
|
||||||
pgSus6.getReadResult() || pgSus7.getReadResult() || pgSus8.getReadResult() ||
|
for (const auto& result : results) {
|
||||||
pgSus9.getReadResult() || pgSus10.getReadResult() || pgSus11.getReadResult());
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SensorValues::updateGyr() {
|
ReturnValue_t SensorValues::updateGyr() {
|
||||||
ReturnValue_t result;
|
std::vector<ReturnValue_t> results;
|
||||||
PoolReadGuard pgGyr0(&gyr0AdisSet), pgGyr1(&gyr1L3gSet), pgGyr2(&gyr2AdisSet),
|
{
|
||||||
pgGyr3(&gyr3L3gSet);
|
PoolReadGuard pgGyr(&gyr0AdisSet);
|
||||||
|
results.push_back(pgGyr.getReadResult());
|
||||||
result = (pgGyr0.getReadResult() || pgGyr1.getReadResult() || pgGyr2.getReadResult() ||
|
}
|
||||||
pgGyr3.getReadResult());
|
{
|
||||||
|
PoolReadGuard pgGyr(&gyr1L3gSet);
|
||||||
|
results.push_back(pgGyr.getReadResult());
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PoolReadGuard pgGyr(&gyr2AdisSet);
|
||||||
|
results.push_back(pgGyr.getReadResult());
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PoolReadGuard pgGyr(&gyr3L3gSet);
|
||||||
|
results.push_back(pgGyr.getReadResult());
|
||||||
|
}
|
||||||
|
for (const auto& result : results) {
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SensorValues::updateStr() {
|
ReturnValue_t SensorValues::updateStr() {
|
||||||
PoolReadGuard pgStr(&strSet);
|
PoolReadGuard pgStr(&strSet);
|
||||||
|
|
||||||
return pgStr.getReadResult();
|
return pgStr.getReadResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,12 +103,29 @@ ReturnValue_t SensorValues::updateGps() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SensorValues::updateRw() {
|
ReturnValue_t SensorValues::updateRw() {
|
||||||
ReturnValue_t result;
|
std::vector<ReturnValue_t> results;
|
||||||
PoolReadGuard pgRw1(&rw1Set), pgRw2(&rw2Set), pgRw3(&rw3Set), pgRw4(&rw4Set);
|
{
|
||||||
|
PoolReadGuard pgRw(&rw1Set);
|
||||||
result = (pgRw1.getReadResult() || pgRw2.getReadResult() || pgRw3.getReadResult() ||
|
results.push_back(pgRw.getReadResult());
|
||||||
pgRw4.getReadResult());
|
}
|
||||||
|
{
|
||||||
|
PoolReadGuard pgRw(&rw2Set);
|
||||||
|
results.push_back(pgRw.getReadResult());
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PoolReadGuard pgRw(&rw3Set);
|
||||||
|
results.push_back(pgRw.getReadResult());
|
||||||
|
}
|
||||||
|
{
|
||||||
|
PoolReadGuard pgRw(&rw4Set);
|
||||||
|
results.push_back(pgRw.getReadResult());
|
||||||
|
}
|
||||||
|
for (const auto& result : results) {
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SensorValues::update() {
|
ReturnValue_t SensorValues::update() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user