1
0
forked from fsfw/fsfw

implemented semaph factory

This commit is contained in:
2020-05-18 20:35:13 +02:00
parent 067cd95731
commit 7227c3a866
8 changed files with 177 additions and 62 deletions

View File

@ -1,10 +1,11 @@
#include <framework/ipc/MutexFactory.h>
#include "../FreeRTOS/Mutex.h"
#include <framework/osal/FreeRTOS/Mutex.h>
//TODO: Different variant than the lazy loading in QueueFactory. What's better and why? -> one is on heap the other on bss/data
//TODO: Different variant than the lazy loading in QueueFactory.
//What's better and why? -> one is on heap the other on bss/data
//MutexFactory* MutexFactory::factoryInstance = new MutexFactory();
MutexFactory* MutexFactory::factoryInstance = NULL;
MutexFactory* MutexFactory::factoryInstance = nullptr;
MutexFactory::MutexFactory() {
}
@ -13,7 +14,7 @@ MutexFactory::~MutexFactory() {
}
MutexFactory* MutexFactory::instance() {
if (factoryInstance == NULL){
if (factoryInstance == nullptr){
factoryInstance = new MutexFactory();
}
return MutexFactory::factoryInstance;