[kernel] rearrange rt_thread_control() - schedule the thread when close it

This commit is contained in:
Meco Man
2021-02-24 16:29:43 +08:00
parent c21f018b4a
commit 2b98ac215a
2 changed files with 79 additions and 76 deletions

View File

@@ -14,18 +14,10 @@ void __rt_libc_exit(int status)
{
rt_thread_t self = rt_thread_self();
#ifdef RT_USING_MODULE
if (dlmodule_self())
{
dlmodule_exit(status);
}
#endif
if (self != RT_NULL)
{
rt_kprintf("thread:%s exit:%d!\n", self->name, status);
rt_thread_suspend(self);
rt_schedule();
rt_thread_control(self, RT_THREAD_CTRL_CLOSE, RT_NULL);
}
}