[kernel] 将rt_thread结构体改为显式继承rt_object (#7131)

This commit is contained in:
Shicheng Chu
2023-04-04 09:06:27 -04:00
committed by GitHub
parent 8a52e65013
commit 93f3cb30e4
49 changed files with 126 additions and 145 deletions
+5 -5
View File
@@ -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)
{