提交 d205cfa6 编写于 作者: A arvinzzz

fix: 进程退出后获取其调度参数有问题

Signed-off-by: Narvinzzz <zhaotianyu9@huawei.com>
Change-Id: I0e98fef07e4919a5fbb051899ecb45a224225f91
上级 b086195e
...@@ -995,7 +995,6 @@ LITE_OS_SEC_TEXT INT32 LOS_SetProcessPriority(INT32 pid, UINT16 prio) ...@@ -995,7 +995,6 @@ LITE_OS_SEC_TEXT INT32 LOS_SetProcessPriority(INT32 pid, UINT16 prio)
LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid) LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid)
{ {
INT32 prio;
UINT32 intSave; UINT32 intSave;
SchedParam param = { 0 }; SchedParam param = { 0 };
(VOID)which; (VOID)which;
...@@ -1011,14 +1010,13 @@ LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid) ...@@ -1011,14 +1010,13 @@ LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid)
LosProcessCB *processCB = OS_PCB_FROM_PID(pid); LosProcessCB *processCB = OS_PCB_FROM_PID(pid);
SCHEDULER_LOCK(intSave); SCHEDULER_LOCK(intSave);
if (OsProcessIsUnused(processCB)) { if (OsProcessIsUnused(processCB)) {
prio = -LOS_ESRCH; SCHEDULER_UNLOCK(intSave);
goto OUT; return -LOS_ESRCH;
} }
LosTaskCB *taskCB = OS_TCB_FROM_TID(processCB->threadGroupID); LosTaskCB *taskCB = OS_TCB_FROM_TID(processCB->threadGroupID);
taskCB->ops->schedParamGet(taskCB, &param); taskCB->ops->schedParamGet(taskCB, &param);
OUT:
SCHEDULER_UNLOCK(intSave); SCHEDULER_UNLOCK(intSave);
return param.basePrio; return param.basePrio;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册