reapply clang format

This commit is contained in:
2022-02-02 10:29:30 +01:00
parent 70b593df65
commit ddcac2bbac
809 changed files with 52010 additions and 56052 deletions

View File

@ -1,32 +1,29 @@
#include "fsfw/osal/host/Mutex.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
Mutex::Mutex() {}
ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType, uint32_t timeoutMs) {
if(timeoutType == TimeoutType::BLOCKING) {
mutex.lock();
return HasReturnvaluesIF::RETURN_OK;
}
else if(timeoutType == TimeoutType::POLLING) {
if(mutex.try_lock()) {
return HasReturnvaluesIF::RETURN_OK;
}
}
else if(timeoutType == TimeoutType::WAITING){
auto chronoMs = std::chrono::milliseconds(timeoutMs);
if(mutex.try_lock_for(chronoMs)) {
return HasReturnvaluesIF::RETURN_OK;
}
}
return MutexIF::MUTEX_TIMEOUT;
if (timeoutType == TimeoutType::BLOCKING) {
mutex.lock();
return HasReturnvaluesIF::RETURN_OK;
} else if (timeoutType == TimeoutType::POLLING) {
if (mutex.try_lock()) {
return HasReturnvaluesIF::RETURN_OK;
}
} else if (timeoutType == TimeoutType::WAITING) {
auto chronoMs = std::chrono::milliseconds(timeoutMs);
if (mutex.try_lock_for(chronoMs)) {
return HasReturnvaluesIF::RETURN_OK;
}
}
return MutexIF::MUTEX_TIMEOUT;
}
ReturnValue_t Mutex::unlockMutex() {
mutex.unlock();
return HasReturnvaluesIF::RETURN_OK;
mutex.unlock();
return HasReturnvaluesIF::RETURN_OK;
}
std::timed_mutex* Mutex::getMutexHandle() {
return &mutex;
}
std::timed_mutex* Mutex::getMutexHandle() { return &mutex; }