/** * @file * @brief RTOS mutex implementation. */ #ifndef STA_RTOS_MUTEX_HPP #define STA_RTOS_MUTEX_HPP #include #include namespace sta { /** * @brief Implementation of Mutex interface using CMSIS RTOS2. * @ingroup STA_RTOS_SYNC */ class RtosMutex : public Mutex { public: /** * @param handle CMSIS RTOS2 mutex */ RtosMutex(osMutexId_t handle); /** * @brief Construct a new Rtos Mutex object * * @param name The name of the mutex. */ RtosMutex(const char* name); /** * @brief Acquire the mutex. */ void acquire() override; /** * @brief Release the mutex. */ void release() override; private: osMutexId_t handle_; /**< CMSIS RTOS2 mutex */ }; } // namespace sta #endif // STA_RTOS_MUTEX_HPP