added semaph factory to linux
This commit is contained in:
parent
f7dd91891a
commit
be4ac0bc8f
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||||
|
|
||||||
|
const uint32_t SemaphoreIF::NO_TIMEOUT = 0;
|
||||||
|
|
||||||
BinarySemaphore::BinarySemaphore() {
|
BinarySemaphore::BinarySemaphore() {
|
||||||
handle = xSemaphoreCreateBinary();
|
handle = xSemaphoreCreateBinary();
|
||||||
if(handle == nullptr) {
|
if(handle == nullptr) {
|
||||||
|
36
osal/linux/SemaphoreFactory.cpp
Normal file
36
osal/linux/SemaphoreFactory.cpp
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#include <framework/tasks/SemaphoreFactory.h>
|
||||||
|
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||||
|
|
||||||
|
const uint32_t SemaphoreIF::NO_TIMEOUT = 0;
|
||||||
|
|
||||||
|
SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr;
|
||||||
|
|
||||||
|
SemaphoreFactory::SemaphoreFactory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
SemaphoreFactory::~SemaphoreFactory() {
|
||||||
|
delete factoryInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
SemaphoreFactory* SemaphoreFactory::instance() {
|
||||||
|
if (factoryInstance == nullptr){
|
||||||
|
factoryInstance = new SemaphoreFactory();
|
||||||
|
}
|
||||||
|
return SemaphoreFactory::factoryInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
SemaphoreIF* SemaphoreFactory::createBinarySemaphore() {
|
||||||
|
sif::error << "Semaphore not implemented for Linux yet" << std::endl;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
SemaphoreIF* SemaphoreFactory::createCountingSemaphore(uint8_t count,
|
||||||
|
uint8_t initCount) {
|
||||||
|
sif::error << "Counting Semaphore not implemented for "
|
||||||
|
"Linux yet" << std::endl;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SemaphoreFactory::deleteMutex(SemaphoreIF* semaphore) {
|
||||||
|
delete semaphore;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user