aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-05-13 12:26:41 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-05-13 12:26:41 +0000
commit03600266786b8b0b6fc000d65350766e2f7d1f25 (patch)
treee3409c1f1c6bcea3d1f97b9a56023e31a88327bf /os/rt/include
parent9b11ca4993ac19f70f182e3cb0fb45537b2d5a4c (diff)
downloadChibiOS-03600266786b8b0b6fc000d65350766e2f7d1f25.tar.gz
ChibiOS-03600266786b8b0b6fc000d65350766e2f7d1f25.tar.bz2
ChibiOS-03600266786b8b0b6fc000d65350766e2f7d1f25.zip
Fixed bug #498.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6932 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chregistry.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/os/rt/include/chregistry.h b/os/rt/include/chregistry.h
index e4cbb0d68..84c6c1a52 100644
--- a/os/rt/include/chregistry.h
+++ b/os/rt/include/chregistry.h
@@ -78,6 +78,26 @@ typedef struct {
/*===========================================================================*/
/**
+ * @name Macro Functions
+ * @{
+ */
+/**
+ * @brief Sets the current thread name.
+ * @pre This function only stores the pointer to the name if the option
+ * @p CH_CFG_USE_REGISTRY is enabled else no action is performed.
+ *
+ * @param[in] p thread name as a zero terminated string
+ *
+ * @api
+ */
+#define chRegSetThreadName(p) (ch.rlist.r_current->p_name = (p))
+/** @} */
+#else /* !CH_CFG_USE_REGISTRY */
+#define chRegSetThreadName(p)
+#endif /* !CH_CFG_USE_REGISTRY */
+
+#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
+/**
* @brief Removes a thread from the registry list.
* @note This macro is not meant for use in application code.
*
@@ -119,24 +139,6 @@ extern "C" {
/*===========================================================================*/
/**
- * @brief Sets the current thread name.
- * @pre This function only stores the pointer to the name if the option
- * @p CH_CFG_USE_REGISTRY is enabled else no action is performed.
- *
- * @param[in] p thread name as a zero terminated string
- *
- * @api
- */
-static inline void chRegSetThreadName(const char *name) {
-
-#if CH_CFG_USE_REGISTRY
- currp->p_name = name;
-#else
- (void)name;
-#endif
-}
-
-/**
* @brief Returns the name of the specified thread.
* @pre This function only returns the pointer to the name if the option
* @p CH_CFG_USE_REGISTRY is enabled else @p NULL is returned.