From 3194fcca0816d4c38b390439ad345ec1ce914555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=92=A6=E8=A1=97?= <15390014138@163.com> Date: Fri, 2 Apr 2021 15:56:30 +0800 Subject: [PATCH] update kernel/base/core/los_process.c. --- kernel/base/core/los_process.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/kernel/base/core/los_process.c b/kernel/base/core/los_process.c index 3f5e62cf..b201094b 100755 --- a/kernel/base/core/los_process.c +++ b/kernel/base/core/los_process.c @@ -1606,19 +1606,16 @@ STATIC UINT32 OsCopyParent(UINT32 flags, LosProcessCB *childProcessCB, LosProces childProcessCB->priority = runProcessCB->priority; if (flags & CLONE_PARENT) { - parentProcessCB = OS_PCB_FROM_PID(runProcessCB->parentProcessID); - childProcessCB->parentProcessID = parentProcessCB->processID; - LOS_ListTailInsert(&parentProcessCB->childrenList, &childProcessCB->siblingList); - childProcessCB->group = parentProcessCB->group; - LOS_ListTailInsert(&parentProcessCB->group->processList, &childProcessCB->subordinateGroupList); - ret = OsCopyUser(childProcessCB, parentProcessCB); + parentProcessCB = OS_PCB_FROM_PID(runProcessCB->parentProcessID); } else { - childProcessCB->parentProcessID = runProcessCB->processID; - LOS_ListTailInsert(&runProcessCB->childrenList, &childProcessCB->siblingList); - childProcessCB->group = runProcessCB->group; - LOS_ListTailInsert(&runProcessCB->group->processList, &childProcessCB->subordinateGroupList); - ret = OsCopyUser(childProcessCB, runProcessCB); + parentProcessCB = runProcessCB; } + childProcessCB->parentProcessID = parentProcessCB->processID; + LOS_ListTailInsert(&parentProcessCB->childrenList, &childProcessCB->siblingList); + childProcessCB->group = parentProcessCB->group; + LOS_ListTailInsert(&parentProcessCB->group->processList, &childProcessCB->subordinateGroupList); + ret = OsCopyUser(childProcessCB, parentProcessCB); + SCHEDULER_UNLOCK(intSave); return ret; }