From 8131d84ea72494d9b60b0ad7477a9f63a1b43f94 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 28 Jun 2015 11:40:14 +0000 Subject: lwIP bindings improvements. Added new function chRegSetThreadNamex(). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8058 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chregistry.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'os/rt/include') diff --git a/os/rt/include/chregistry.h b/os/rt/include/chregistry.h index ca90f26dd..cfec32eeb 100644 --- a/os/rt/include/chregistry.h +++ b/os/rt/include/chregistry.h @@ -148,11 +148,8 @@ extern "C" { * @return Thread name as a zero terminated string. * @retval NULL if the thread name has not been set. * - * @iclass */ -static inline const char *chRegGetThreadNameI(thread_t *tp) { - - chDbgCheckClassI(); +static inline const char *chRegGetThreadNameX(thread_t *tp) { #if CH_CFG_USE_REGISTRY == TRUE return tp->p_name; @@ -162,6 +159,26 @@ static inline const char *chRegGetThreadNameI(thread_t *tp) { #endif } +/** + * @brief Changes the name of the specified thread. + * @pre This function only sets the name if the option + * @p CH_CFG_USE_REGISTRY is enabled else it does + * nothing. + * + * @param[in] tp pointer to the thread + * @param[in] name name to be set + * + * @xclass + */ +static inline void chRegSetThreadNameX(thread_t *tp, const char *name) { + +#if CH_CFG_USE_REGISTRY == TRUE + tp->p_name = name; +#else + (void)tp; + (void)name; +#endif +} #endif /* CH_CFG_USE_REGISTRY == TRUE */ #endif /* _CHREGISTRY_H_ */ -- cgit v1.2.3