diff --git a/sys/include/xtimer.h b/sys/include/xtimer.h index 30ecf5cdae..c6997f329e 100644 --- a/sys/include/xtimer.h +++ b/sys/include/xtimer.h @@ -37,6 +37,7 @@ #endif /* MODULE_CORE_MSG */ #include "mutex.h" #include "kernel_types.h" +#include "rmutex.h" #ifdef MODULE_ZTIMER_XTIMER_COMPAT #include "ztimer/xtimer_compat.h" @@ -413,7 +414,19 @@ static inline bool xtimer_less64(xtimer_ticks64_t a, xtimer_ticks64_t b); */ int xtimer_mutex_lock_timeout(mutex_t *mutex, uint64_t us); +/** + * @brief lock a rmutex but with timeout + * + * @param[in] rmutex rmutex to lock + * @param[in] us timeout in microseconds relative + * + * @return 0, when returned after rmutex was locked + * @return -1, when the timeout occcured + */ +int xtimer_rmutex_lock_timeout(rmutex_t *rmutex, uint64_t us); + #if defined(MODULE_CORE_THREAD_FLAGS) || defined(DOXYGEN) + /** * @brief Set timeout thread flag after @p timeout *