提交 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)
LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid)
{
INT32 prio;
UINT32 intSave;
SchedParam param = { 0 };
(VOID)which;
......@@ -1011,14 +1010,13 @@ LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid)
LosProcessCB *processCB = OS_PCB_FROM_PID(pid);
SCHEDULER_LOCK(intSave);
if (OsProcessIsUnused(processCB)) {
prio = -LOS_ESRCH;
goto OUT;
SCHEDULER_UNLOCK(intSave);
return -LOS_ESRCH;
}
LosTaskCB *taskCB = OS_TCB_FROM_TID(processCB->threadGroupID);
taskCB->ops->schedParamGet(taskCB, &param);
OUT:
SCHEDULER_UNLOCK(intSave);
return param.basePrio;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册