diff options
| author | Meco Man <[email protected]> | 2021-12-27 20:34:35 -0500 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2021-12-27 20:34:35 -0500 |
| commit | 1f2e93f1a39590af9a71ecc31b12045696ca6055 (patch) | |
| tree | 4edaa558175c3c47e1c09fa3eea172606eb1f1a7 /src | |
| parent | 008eaed0f1970935acf1909b2180e320d5e4f808 (diff) | |
[kernel] remove .init_priority
Diffstat (limited to 'src')
| -rw-r--r-- | src/thread.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/thread.c b/src/thread.c index 7913e12f5d..2f06cedd44 100644 --- a/src/thread.c +++ b/src/thread.c @@ -28,6 +28,7 @@ * add support for tasks bound to cpu * 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-12-27 Meco Man remove .init_priority */ #include <rthw.h> @@ -138,7 +139,6 @@ static rt_err_t _thread_init(struct rt_thread *thread, /* priority init */ RT_ASSERT(priority < RT_THREAD_PRIORITY_MAX); - thread->init_priority = priority; thread->current_priority = priority; thread->number_mask = 0; @@ -297,9 +297,6 @@ rt_err_t rt_thread_startup(rt_thread_t thread) 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); - /* set current priority to initialize priority */ - thread->current_priority = thread->init_priority; - /* calculate priority attribute */ #if RT_THREAD_PRIORITY_MAX > 32 thread->number = thread->current_priority >> 3; /* 5bit */ @@ -310,7 +307,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->init_priority)); + thread->name, thread->current_priority)); /* change thread stat */ thread->stat = RT_THREAD_SUSPEND; /* then resume it */ |
