added host osal
This commit is contained in:
42
osal/host/SemaphoreFactory.cpp
Normal file
42
osal/host/SemaphoreFactory.cpp
Normal file
@ -0,0 +1,42 @@
|
||||
#include <framework/tasks/SemaphoreFactory.h>
|
||||
#include <framework/osal/linux/BinarySemaphore.h>
|
||||
#include <framework/osal/linux/CountingSemaphore.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
const uint32_t SemaphoreIF::POLLING = 0;
|
||||
const uint32_t SemaphoreIF::BLOCKING = 0xFFFFFFFF;
|
||||
|
||||
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(uint32_t arguments) {
|
||||
// Just gonna wait for full C++20 for now.
|
||||
sif::error << "SemaphoreFactory: Binary Semaphore not implemented yet."
|
||||
" Returning nullptr!\n" << std::flush;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SemaphoreIF* SemaphoreFactory::createCountingSemaphore(const uint8_t maxCount,
|
||||
uint8_t initCount, uint32_t arguments) {
|
||||
// Just gonna wait for full C++20 for now.
|
||||
sif::error << "SemaphoreFactory: Counting Semaphore not implemented yet."
|
||||
" Returning nullptr!\n" << std::flush;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void SemaphoreFactory::deleteSemaphore(SemaphoreIF* semaphore) {
|
||||
delete semaphore;
|
||||
}
|
Reference in New Issue
Block a user