action
container
contrib
controller
coordinates
datalinklayer
datapool
devicehandlers
events
fdir
globalfunctions
health
internalError
ipc
memory
modes
monitoring
objectmanager
osal
FreeRTOS
Clock.cpp
FixedTimeslotTask.cpp
FixedTimeslotTask.h
MessageQueue.cpp
MessageQueue.h
Mutex.cpp
Mutex.h
MutexFactory.cpp
PeriodicTask.cpp
PeriodicTask.h
QueueFactory.cpp
README.md
TaskFactory.cpp
Timekeeper.cpp
Timekeeper.h
linux
rtems
Endiness.h
InternalErrorCodes.h
parameters
power
returnvalues
rmap
serialize
serviceinterface
storagemanager
subsystem
tasks
tcdistribution
thermal
timemanager
tmstorage
tmtcpacket
tmtcservices
.gitignore
LICENSE
NOTICE
framework.mk
29 lines
677 B
C++
29 lines
677 B
C++
#include <framework/ipc/MutexFactory.h>
|
|
|
|
#include "../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
|
|
//MutexFactory* MutexFactory::factoryInstance = new MutexFactory();
|
|
MutexFactory* MutexFactory::factoryInstance = NULL;
|
|
|
|
MutexFactory::MutexFactory() {
|
|
}
|
|
|
|
MutexFactory::~MutexFactory() {
|
|
}
|
|
|
|
MutexFactory* MutexFactory::instance() {
|
|
if (factoryInstance == NULL){
|
|
factoryInstance = new MutexFactory();
|
|
}
|
|
return MutexFactory::factoryInstance;
|
|
}
|
|
|
|
MutexIF* MutexFactory::createMutex() {
|
|
return new Mutex();
|
|
}
|
|
|
|
void MutexFactory::deleteMutex(MutexIF* mutex) {
|
|
delete mutex;
|
|
}
|