doxygen: updated doc for thread management subsystem

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
This commit is contained in:
Chen Wang
2025-09-02 15:37:30 +08:00
committed by R b b666
parent 98a12f1c24
commit f44ce3a64c
5 changed files with 165 additions and 230 deletions

View File

@@ -848,9 +848,8 @@ struct rt_user_context
typedef void (*rt_thread_cleanup_t)(struct rt_thread *tid);
/**
* Thread structure
* @brief Thread Control Block
*/
struct rt_thread
{
struct rt_object parent;

View File

@@ -208,7 +208,30 @@ RT_OBJECT_HOOKLIST_DECLARE(rt_thread_inited_hookproto_t, rt_thread_inited);
*/
void rt_thread_idle_init(void);
#if defined(RT_USING_HOOK) || defined(RT_USING_IDLE_HOOK)
// FIXME: Have to write doxygen comment here for rt_thread_idle_sethook/rt_thread_idle_delhook
// but not in src/idle.c. Because the `rt_align(RT_ALIGN_SIZE)` in src/idle.c
// will make wierd output for html document generation, i.e. can not generate
// function link to rt_thread_idle_sethook, while function link to rt_thread_idle_delhook is ok.
/**
* @brief This function sets a hook function to idle thread loop. When the system performs
* idle loop, this hook function should be invoked.
*
* @param hook the specified hook function.
*
* @return `RT_EOK`: set OK.
* `-RT_EFULL`: hook list is full.
*
* @note the hook function must be simple and never be blocked or suspend.
*/
rt_err_t rt_thread_idle_sethook(void (*hook)(void));
/**
* @brief delete the idle hook on hook list.
*
* @param hook the specified hook function.
*
* @return `RT_EOK`: delete OK.
* `-RT_ENOSYS`: hook was not found.
*/
rt_err_t rt_thread_idle_delhook(void (*hook)(void));
#endif /* defined(RT_USING_HOOK) || defined(RT_USING_IDLE_HOOK) */
rt_thread_t rt_thread_idle_gethandler(void);