mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-21 01:07:18 +08:00
feat: add memset zero for rt_thread_init
`rt_object_allocate()` will clear memory after new rt_thread allocate in `rt_thread_create()`. However, in `rt_thread_init()` the same behavior is missing, which corrupt the consistence of the API. Changes: - Added `memset()` zero for `rt_thread_init()` in the entry Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
parent
82f30aa54f
commit
cbf6b641c2
@ -334,6 +334,9 @@ rt_err_t rt_thread_init(struct rt_thread *thread,
|
||||
RT_ASSERT(stack_start != RT_NULL);
|
||||
RT_ASSERT(tick != 0);
|
||||
|
||||
/* clean memory data of thread */
|
||||
rt_memset(thread, 0x0, sizeof(struct rt_thread));
|
||||
|
||||
/* initialize thread object */
|
||||
rt_object_init((rt_object_t)thread, RT_Object_Class_Thread, name);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user