new timeout values for MUtexIF and SemaphIF

This commit is contained in:
Robin Müller 2020-06-02 22:10:34 +02:00
parent de6ed5c085
commit f0a25b5e2b
2 changed files with 30 additions and 6 deletions

View File

@ -12,8 +12,21 @@
*/ */
class MutexIF { class MutexIF {
public: public:
static const uint32_t NO_TIMEOUT; //!< Needs to be defined in implementation. /**
static const uint32_t MAX_TIMEOUT; * @brief Timeout value used for polling lock attempt.
* @details
* If the lock is not successfull, MUTEX_TIMEOUT will be returned
* immediately. Value needs to be defined in implementation.
*/
static const uint32_t POLLING;
/**
* @brief Timeout value used for permanent blocking lock attempt.
* @details
* The task will be blocked (indefinitely) until the mutex is unlocked.
* Value needs to be defined in implementation.
*/
static const uint32_t BLOCKING;
static const uint8_t INTERFACE_ID = CLASS_ID::MUTEX_IF; static const uint8_t INTERFACE_ID = CLASS_ID::MUTEX_IF;
/** /**
* The system lacked the necessary resources (other than memory) to initialize another mutex. * The system lacked the necessary resources (other than memory) to initialize another mutex.

View File

@ -21,10 +21,21 @@
class SemaphoreIF { class SemaphoreIF {
public: public:
virtual~ SemaphoreIF() {}; virtual~ SemaphoreIF() {};
//! Needs to be defined in implementation. No blocking time /**
static const uint32_t NO_TIMEOUT; * @brief Timeout value used for polling lock attempt.
//! Needs to be defined in implementation. Blocks indefinitely. * @details
static const uint32_t MAX_TIMEOUT; * If the lock is not successfull, MUTEX_TIMEOUT will be returned
* immediately. Value needs to be defined in implementation.
*/
static const uint32_t POLLING;
/**
* @brief Timeout value used for permanent blocking lock attempt.
* @details
* The task will be blocked (indefinitely) until the mutex is unlocked.
* Value needs to be defined in implementation.
*/
static const uint32_t BLOCKING;
static const uint8_t INTERFACE_ID = CLASS_ID::SEMAPHORE_IF; static const uint8_t INTERFACE_ID = CLASS_ID::SEMAPHORE_IF;
//! Semaphore timeout //! Semaphore timeout
static constexpr ReturnValue_t SEMAPHORE_TIMEOUT = MAKE_RETURN_CODE(1); static constexpr ReturnValue_t SEMAPHORE_TIMEOUT = MAKE_RETURN_CODE(1);