Merge pull request #5443 from mysterywolf/removeinit

[kernel] remove .init_priority
This commit is contained in:
Bernard Xiong 2022-01-14 22:55:54 +08:00 committed by GitHub
commit 43e7186a99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -645,7 +645,6 @@ struct rt_thread
/* priority */ /* priority */
rt_uint8_t current_priority; /**< current priority */ rt_uint8_t current_priority; /**< current priority */
rt_uint8_t init_priority; /**< initialized priority */
#if RT_THREAD_PRIORITY_MAX > 32 #if RT_THREAD_PRIORITY_MAX > 32
rt_uint8_t number; rt_uint8_t number;
rt_uint8_t high_mask; rt_uint8_t high_mask;

View File

@ -28,6 +28,7 @@
* add support for tasks bound to cpu * add support for tasks bound to cpu
* 2021-02-24 Meco Man rearrange rt_thread_control() - schedule the thread when close it * 2021-02-24 Meco Man rearrange rt_thread_control() - schedule the thread when close it
* 2021-11-15 THEWON Remove duplicate work between idle and _thread_exit * 2021-11-15 THEWON Remove duplicate work between idle and _thread_exit
* 2021-12-27 Meco Man remove .init_priority
* 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to thread.c * 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to thread.c
*/ */
@ -186,7 +187,6 @@ static rt_err_t _thread_init(struct rt_thread *thread,
/* priority init */ /* priority init */
RT_ASSERT(priority < RT_THREAD_PRIORITY_MAX); RT_ASSERT(priority < RT_THREAD_PRIORITY_MAX);
thread->init_priority = priority;
thread->current_priority = priority; thread->current_priority = priority;
thread->number_mask = 0; thread->number_mask = 0;
@ -345,9 +345,6 @@ rt_err_t rt_thread_startup(rt_thread_t thread)
RT_ASSERT((thread->stat & RT_THREAD_STAT_MASK) == RT_THREAD_INIT); RT_ASSERT((thread->stat & RT_THREAD_STAT_MASK) == RT_THREAD_INIT);
RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread); RT_ASSERT(rt_object_get_type((rt_object_t)thread) == RT_Object_Class_Thread);
/* set current priority to initialize priority */
thread->current_priority = thread->init_priority;
/* calculate priority attribute */ /* calculate priority attribute */
#if RT_THREAD_PRIORITY_MAX > 32 #if RT_THREAD_PRIORITY_MAX > 32
thread->number = thread->current_priority >> 3; /* 5bit */ thread->number = thread->current_priority >> 3; /* 5bit */
@ -358,7 +355,7 @@ rt_err_t rt_thread_startup(rt_thread_t thread)
#endif /* RT_THREAD_PRIORITY_MAX > 32 */ #endif /* RT_THREAD_PRIORITY_MAX > 32 */
RT_DEBUG_LOG(RT_DEBUG_THREAD, ("startup a thread:%s with priority:%d\n", RT_DEBUG_LOG(RT_DEBUG_THREAD, ("startup a thread:%s with priority:%d\n",
thread->name, thread->init_priority)); thread->name, thread->current_priority));
/* change thread stat */ /* change thread stat */
thread->stat = RT_THREAD_SUSPEND; thread->stat = RT_THREAD_SUSPEND;
/* then resume it */ /* then resume it */