mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-20 05:25:04 +08:00
[kernel] rearrange rt_thread_control() - schedule the thread when close it
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user