renamed timeout values
This commit is contained in:
@ -27,13 +27,13 @@ BinarySemaphore& BinarySemaphore::operator =(
|
||||
|
||||
ReturnValue_t BinarySemaphore::acquire(uint32_t timeoutMs) {
|
||||
int result = 0;
|
||||
if(timeoutMs == SemaphoreIF::NO_TIMEOUT) {
|
||||
if(timeoutMs == SemaphoreIF::POLLING) {
|
||||
result = sem_trywait(&handle);
|
||||
}
|
||||
else if(timeoutMs == SemaphoreIF::MAX_TIMEOUT) {
|
||||
else if(timeoutMs == SemaphoreIF::BLOCKING) {
|
||||
result = sem_wait(&handle);
|
||||
}
|
||||
else if(timeoutMs > SemaphoreIF::NO_TIMEOUT){
|
||||
else if(timeoutMs > SemaphoreIF::POLLING){
|
||||
timespec timeOut;
|
||||
clock_gettime(CLOCK_REALTIME, &timeOut);
|
||||
uint64_t nseconds = timeOut.tv_sec * 1000000000 + timeOut.tv_nsec;
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
* -@c SemaphoreIF::SEMAPHORE_TIMEOUT on timeout
|
||||
*/
|
||||
ReturnValue_t acquire(uint32_t timeoutMs =
|
||||
SemaphoreIF::NO_TIMEOUT) override;
|
||||
SemaphoreIF::BLOCKING) override;
|
||||
|
||||
/**
|
||||
* Release the binary semaphore.
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include <framework/osal/linux/CountingSemaphore.h>
|
||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
const uint32_t SemaphoreIF::NO_TIMEOUT = 0;
|
||||
const uint32_t SemaphoreIF::MAX_TIMEOUT = 0xFFFFFFFF;
|
||||
const uint32_t SemaphoreIF::POLLING = 0;
|
||||
const uint32_t SemaphoreIF::BLOCKING = 0xffffffff;
|
||||
|
||||
SemaphoreFactory* SemaphoreFactory::factoryInstance = nullptr;
|
||||
|
||||
|
Reference in New Issue
Block a user