[smart] fixup: lwp_free() (#8126)

Signed-off-by: shell <wangxiaoyao@rt-thread.com>
This commit is contained in:
Shell 2023-10-13 14:21:06 +08:00 committed by GitHub
parent 6c1537c216
commit 8e57b5fdd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -425,6 +425,7 @@ void lwp_free(struct rt_lwp* lwp)
#ifdef ARCH_MM_MMU
lwp_unmap_user_space(lwp);
#endif
timer_list_free(&lwp->timer);
level = rt_hw_interrupt_disable();
/* for children */
@ -506,7 +507,6 @@ void lwp_free(struct rt_lwp* lwp)
}
}
timer_list_free(&lwp->timer);
lwp_pid_put(lwp_to_pid(lwp));
rt_hw_interrupt_enable(level);
rt_free(lwp);
@ -706,6 +706,7 @@ pid_t waitpid(pid_t pid, int *status, int options)
}
(*lwp_node) = lwp->sibling;
lwp->parent = RT_NULL;
lwp_pid_put(pid);
}
quit: