Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions components/lwp/lwp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand All @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions components/lwp/lwp_pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ;
Expand Down