WIP: somethings wrong.. #19
@ -2,8 +2,6 @@
|
|||||||
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
#include <framework/serviceinterface/ServiceInterfaceStream.h>
|
||||||
#include <framework/timemanager/Clock.h>
|
#include <framework/timemanager/Clock.h>
|
||||||
|
|
||||||
const uint32_t MutexIF::BLOCKING = 0xffffffff;
|
|
||||||
const uint32_t MutexIF::POLLING = 0;
|
|
||||||
uint8_t Mutex::count = 0;
|
uint8_t Mutex::count = 0;
|
||||||
|
|
||||||
|
|
||||||
@ -61,22 +59,28 @@ ReturnValue_t Mutex::lockMutex(TimeoutType timeoutType, uint32_t timeoutMs) {
|
|||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case EINVAL:
|
case EINVAL:
|
||||||
//The mutex was created with the protocol attribute having the value PTHREAD_PRIO_PROTECT and the calling thread's priority is higher than the mutex's current priority ceiling.
|
// The mutex was created with the protocol attribute having the value
|
||||||
|
// PTHREAD_PRIO_PROTECT and the calling thread's priority is higher
|
||||||
|
// than the mutex's current priority ceiling.
|
||||||
return WRONG_ATTRIBUTE_SETTING;
|
return WRONG_ATTRIBUTE_SETTING;
|
||||||
//The process or thread would have blocked, and the abs_timeout parameter specified a nanoseconds field value less than zero or greater than or equal to 1000 million.
|
// The process or thread would have blocked, and the abs_timeout
|
||||||
//The value specified by mutex does not refer to an initialized mutex object.
|
// parameter specified a nanoseconds field value less than zero or
|
||||||
|
// greater than or equal to 1000 million.
|
||||||
|
// The value specified by mutex does not refer to an initialized mutex object.
|
||||||
//return MUTEX_NOT_FOUND;
|
//return MUTEX_NOT_FOUND;
|
||||||
case EBUSY:
|
case EBUSY:
|
||||||
//The mutex could not be acquired because it was already locked.
|
// The mutex could not be acquired because it was already locked.
|
||||||
return MUTEX_ALREADY_LOCKED;
|
return MUTEX_ALREADY_LOCKED;
|
||||||
case ETIMEDOUT:
|
case ETIMEDOUT:
|
||||||
//The mutex could not be locked before the specified timeout expired.
|
// The mutex could not be locked before the specified timeout expired.
|
||||||
return MUTEX_TIMEOUT;
|
return MUTEX_TIMEOUT;
|
||||||
case EAGAIN:
|
case EAGAIN:
|
||||||
//The mutex could not be acquired because the maximum number of recursive locks for mutex has been exceeded.
|
// The mutex could not be acquired because the maximum number of
|
||||||
|
// recursive locks for mutex has been exceeded.
|
||||||
return MUTEX_MAX_LOCKS;
|
return MUTEX_MAX_LOCKS;
|
||||||
case EDEADLK:
|
case EDEADLK:
|
||||||
//A deadlock condition was detected or the current thread already owns the mutex.
|
// A deadlock condition was detected or the current thread
|
||||||
|
// already owns the mutex.
|
||||||
return CURR_THREAD_ALREADY_OWNS_MUTEX;
|
return CURR_THREAD_ALREADY_OWNS_MUTEX;
|
||||||
case 0:
|
case 0:
|
||||||
//Success
|
//Success
|
||||||
|
Loading…
Reference in New Issue
Block a user