From abd765732218e17bbaa8789729eee40ccd2f8f9e Mon Sep 17 00:00:00 2001 From: heyuanjie87 <943313837@qq.com> Date: Fri, 7 Mar 2025 17:30:07 +0800 Subject: [PATCH] =?UTF-8?q?[lwp]=E5=B0=86=E8=BF=9B=E7=A8=8B=E7=9A=84?= =?UTF-8?q?=E9=94=80=E6=AF=81=E6=93=8D=E4=BD=9C=E6=94=BE=E8=BF=9B=E6=9C=AC?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/lwp/lwp.c | 12 ------------ components/lwp/lwp_pid.c | 2 ++ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/components/lwp/lwp.c b/components/lwp/lwp.c index f5435bcea51..444cebe4c55 100644 --- a/components/lwp/lwp.c +++ b/components/lwp/lwp.c @@ -166,8 +166,6 @@ uint32_t *lwp_get_kernel_sp(void) /* lwp-thread clean up routine */ void lwp_cleanup(struct rt_thread *tid) { - struct rt_lwp *lwp; - if (tid == NULL) { LOG_I("%s: invalid parameter tid == NULL", __func__); @@ -176,18 +174,8 @@ void lwp_cleanup(struct rt_thread *tid) else LOG_D("cleanup thread: %s, stack_addr: 0x%x", tid->parent.name, tid->stack_addr); - /** - * Brief: lwp thread cleanup - * - * Note: Critical Section - * - thread control block (RW. It's ensured that no one else can access tcb - * other than itself) - */ - lwp = (struct rt_lwp *)tid->lwp; lwp_thread_signal_detach(&tid->signal); - /* tty will be release in lwp_ref_dec() if ref is cleared */ - lwp_ref_dec(lwp); return; } diff --git a/components/lwp/lwp_pid.c b/components/lwp/lwp_pid.c index 34285598dfb..14e5d61b4b3 100644 --- a/components/lwp/lwp_pid.c +++ b/components/lwp/lwp_pid.c @@ -604,6 +604,8 @@ void _thread_exit(rt_lwp_t lwp, rt_thread_t thread) lwp_tid_put(thread->tid); thread->tid = 0; + lwp_ref_dec(lwp); + rt_thread_delete(thread); rt_schedule(); while (1) ;