提交 ea12d40c 编写于 作者: Z zhushengle

fix: tick中断处理时,无挂起任务时应更新当前运行任务的时间片, 并触发一次调度

Close #I4LRZG
Signed-off-by: Nzhushengle <zhushengle@huawei.com>
Change-Id: I4472fb50c775b832688aa7a555498901a80e2999
上级 a1b4ebd4
...@@ -642,8 +642,6 @@ UINT64 LOS_SchedTickTimeoutNsGet(VOID) ...@@ -642,8 +642,6 @@ UINT64 LOS_SchedTickTimeoutNsGet(VOID)
VOID LOS_SchedTickHandler(VOID) VOID LOS_SchedTickHandler(VOID)
{ {
BOOL needSched = FALSE;
if (!g_taskScheduled) { if (!g_taskScheduled) {
return; return;
} }
...@@ -653,19 +651,21 @@ VOID LOS_SchedTickHandler(VOID) ...@@ -653,19 +651,21 @@ VOID LOS_SchedTickHandler(VOID)
if (g_schedResponseID == OS_INVALID) { if (g_schedResponseID == OS_INVALID) {
g_tickIntLock++; g_tickIntLock++;
if (g_swtmrScan != NULL) { if (g_swtmrScan != NULL) {
needSched = g_swtmrScan(); (VOID)g_swtmrScan();
} }
needSched |= OsSchedScanTimerList(); (VOID)OsSchedScanTimerList();
g_tickIntLock--; g_tickIntLock--;
} }
OsTimeSliceUpdate(g_losTask.runTask, g_tickStartTime);
g_losTask.runTask->startTime = OsGetCurrSchedTimeCycle();
g_schedResponseTime = OS_SCHED_MAX_RESPONSE_TIME; g_schedResponseTime = OS_SCHED_MAX_RESPONSE_TIME;
if (needSched && LOS_CHECK_SCHEDULE) { if (LOS_CHECK_SCHEDULE) {
HalTaskSchedule(); HalTaskSchedule();
} else { } else {
OsTimeSliceUpdate(g_losTask.runTask, g_tickStartTime); OsSchedUpdateExpireTime(g_losTask.runTask->startTime, TRUE);
OsSchedUpdateExpireTime(g_tickStartTime, TRUE);
} }
LOS_IntRestore(intSave); LOS_IntRestore(intSave);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册