fsfw/osal/FreeRTOS/MutexFactory.cpp

31 lines
670 B
C++
Raw Normal View History

2020-12-14 11:19:05 +01:00
#include "Mutex.h"
2020-08-28 18:33:29 +02:00
#include "../../ipc/MutexFactory.h"
2020-12-14 11:19:05 +01:00
2020-08-28 18:33:29 +02:00
//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 = nullptr;
MutexFactory::MutexFactory() {
}
MutexFactory::~MutexFactory() {
}
MutexFactory* MutexFactory::instance() {
if (factoryInstance == nullptr){
factoryInstance = new MutexFactory();
}
return MutexFactory::factoryInstance;
}
MutexIF* MutexFactory::createMutex() {
return new Mutex();
}
void MutexFactory::deleteMutex(MutexIF* mutex) {
delete mutex;
}