From 2b98ac215a4e07401464bfcd6ad00957ff03bd72 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 24 Feb 2021 16:29:43 +0800 Subject: [kernel] rearrange rt_thread_control() - schedule the thread when close it --- components/libc/compilers/common/stdlib.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'components') diff --git a/components/libc/compilers/common/stdlib.c b/components/libc/compilers/common/stdlib.c index 9f801ab966..48a86098cd 100644 --- a/components/libc/compilers/common/stdlib.c +++ b/components/libc/compilers/common/stdlib.c @@ -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); } } -- cgit v1.3.1