summaryrefslogtreecommitdiff
path: root/include/rtthread.h
diff options
context:
space:
mode:
authorShell <[email protected]>2023-12-23 17:59:18 +0800
committerMeco Man <[email protected]>2024-01-02 19:42:46 +0800
commite7880a9713ef3efed9ad133231981761bcc3e4eb (patch)
tree14909d6f79c1c39c89aa462a58779542e6f415d2 /include/rtthread.h
parent3a7903b799c9f379048368df029cac3e42c28be4 (diff)
[kernel] support for hook list
Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'include/rtthread.h')
-rw-r--r--include/rtthread.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/rtthread.h b/include/rtthread.h
index fc14e50de1..93fd138334 100644
--- a/include/rtthread.h
+++ b/include/rtthread.h
@@ -179,7 +179,15 @@ int rt_thread_kill(rt_thread_t tid, int sig);
#ifdef RT_USING_HOOK
void rt_thread_suspend_sethook(void (*hook)(rt_thread_t thread));
void rt_thread_resume_sethook (void (*hook)(rt_thread_t thread));
-void rt_thread_inited_sethook (void (*hook)(rt_thread_t thread));
+
+/**
+ * @brief Sets a hook function when a thread is initialized.
+ *
+ * @param thread is the target thread that initializing
+ */
+typedef void (*rt_thread_inited_hookproto_t)(rt_thread_t thread);
+RT_OBJECT_HOOKLIST_DECLARE(rt_thread_inited_hookproto_t, rt_thread_inited);
+
#endif /* RT_USING_HOOK */
/*