summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
authorShicheng Chu <[email protected]>2023-04-04 21:06:27 +0800
committerGitHub <[email protected]>2023-04-04 09:06:27 -0400
commit93f3cb30e48d5de341bda09fa806120e2bc3f3ad (patch)
treeb23b2343674fecbc3fdfbcd49220488da21472ed /src/thread.c
parent8a52e65013d1abb7cfc032409000533000ccd0c2 (diff)
[kernel] 将rt_thread结构体改为显式继承rt_object (#7131)
Diffstat (limited to 'src/thread.c')
-rw-r--r--src/thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/thread.c b/src/thread.c
index 5614edea4d..56f9094ab0 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -237,7 +237,7 @@ static rt_err_t _thread_init(struct rt_thread *thread,
/* initialize thread timer */
rt_timer_init(&(thread->thread_timer),
- thread->name,
+ thread->parent.name,
_thread_timeout,
thread,
0,
@@ -274,7 +274,7 @@ static rt_err_t _thread_init(struct rt_thread *thread,
#endif /* RT_USING_PTHREADS */
#ifdef RT_USING_MODULE
- thread->module_id = 0;
+ thread->parent.module_id = 0;
#endif /* RT_USING_MODULE */
RT_OBJECT_HOOK_CALL(rt_thread_inited_hook, (thread));
@@ -386,7 +386,7 @@ rt_err_t rt_thread_startup(rt_thread_t thread)
#endif /* RT_THREAD_PRIORITY_MAX > 32 */
RT_DEBUG_LOG(RT_DEBUG_THREAD, ("startup a thread:%s with priority:%d\n",
- thread->name, thread->current_priority));
+ thread->parent.name, thread->current_priority));
/* change thread stat */
thread->stat = RT_THREAD_SUSPEND;
/* then resume it */
@@ -983,7 +983,7 @@ rt_err_t rt_thread_suspend_with_flag(rt_thread_t thread, int suspend_flag)
RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread);
RT_ASSERT(thread == rt_thread_self());
- RT_DEBUG_LOG(RT_DEBUG_THREAD, ("thread suspend: %s\n", thread->name));
+ RT_DEBUG_LOG(RT_DEBUG_THREAD, ("thread suspend: %s\n", thread->parent.name));
stat = thread->stat & RT_THREAD_STAT_MASK;
if ((stat != RT_THREAD_READY) && (stat != RT_THREAD_RUNNING))
@@ -1046,7 +1046,7 @@ rt_err_t rt_thread_resume(rt_thread_t thread)
RT_ASSERT(thread != RT_NULL);
RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread);
- RT_DEBUG_LOG(RT_DEBUG_THREAD, ("thread resume: %s\n", thread->name));
+ RT_DEBUG_LOG(RT_DEBUG_THREAD, ("thread resume: %s\n", thread->parent.name));
if ((thread->stat & RT_THREAD_SUSPEND_MASK) != RT_THREAD_SUSPEND_MASK)
{