mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-18 18:39:11 +08:00
✨ feat: fix pid recycling (#8225)
This commit is contained in:
parent
b51a3420b0
commit
fa9b496b2a
@ -1308,9 +1308,17 @@ static void _resr_cleanup(struct rt_lwp *lwp)
|
||||
/** @note safe since the slist node is release */
|
||||
LWP_UNLOCK(lwp);
|
||||
LWP_LOCK(child);
|
||||
child->sibling = RT_NULL;
|
||||
/* info: this may cause an orphan lwp */
|
||||
child->parent = RT_NULL;
|
||||
if (child->terminated)
|
||||
{
|
||||
lwp_pid_put(child);
|
||||
}
|
||||
else
|
||||
{
|
||||
child->sibling = RT_NULL;
|
||||
/* info: this may cause an orphan lwp */
|
||||
child->parent = RT_NULL;
|
||||
}
|
||||
|
||||
LWP_UNLOCK(child);
|
||||
lwp_ref_dec(child);
|
||||
lwp_ref_dec(lwp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user