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

This commit is contained in:
Shicheng Chu
2023-04-04 21:06:27 +08:00
committed by GitHub
parent 8a52e65013
commit 93f3cb30e4
49 changed files with 126 additions and 145 deletions

View File

@@ -1525,7 +1525,7 @@ long _sys_clone(void *arg[])
goto fail;
}
thread = rt_thread_create(self->name,
thread = rt_thread_create(self->parent.name,
RT_NULL,
RT_NULL,
self->stack_size,
@@ -1713,7 +1713,7 @@ sysret_t _sys_fork(void)
/* create thread */
self_thread = rt_thread_self();
thread = rt_thread_create(self_thread->name,
thread = rt_thread_create(self_thread->parent.name,
RT_NULL,
RT_NULL,
self_thread->stack_size,
@@ -2361,7 +2361,7 @@ sysret_t sys_execve(const char *path, char *const argv[], char *const envp[])
/* load ok, now set thread name and swap the data of lwp and new_lwp */
level = rt_hw_interrupt_disable();
rt_strncpy(thread->name, run_name + last_backslash, RT_NAME_MAX);
rt_strncpy(thread->parent.name, run_name + last_backslash, RT_NAME_MAX);
rt_pages_free(page, 0);
@@ -2420,7 +2420,7 @@ rt_err_t sys_thread_delete(rt_thread_t thread)
#else
rt_err_t ret = 0;
if(thread->type != RT_Object_Class_Thread)
if(thread->parent.type != RT_Object_Class_Thread)
{
ret = -EINVAL;
goto __exit;