diff --git a/kernel/src/los_sched.c b/kernel/src/los_sched.c index 8f85c06d9d47139c06097cf1ac2d95f911059966..a72bd4dff101faa3d6f2238e4f4b0febde233f04 100644 --- a/kernel/src/los_sched.c +++ b/kernel/src/los_sched.c @@ -642,8 +642,6 @@ UINT64 LOS_SchedTickTimeoutNsGet(VOID) VOID LOS_SchedTickHandler(VOID) { - BOOL needSched = FALSE; - if (!g_taskScheduled) { return; } @@ -653,19 +651,21 @@ VOID LOS_SchedTickHandler(VOID) if (g_schedResponseID == OS_INVALID) { g_tickIntLock++; if (g_swtmrScan != NULL) { - needSched = g_swtmrScan(); + (VOID)g_swtmrScan(); } - needSched |= OsSchedScanTimerList(); + (VOID)OsSchedScanTimerList(); g_tickIntLock--; } + OsTimeSliceUpdate(g_losTask.runTask, g_tickStartTime); + g_losTask.runTask->startTime = OsGetCurrSchedTimeCycle(); + g_schedResponseTime = OS_SCHED_MAX_RESPONSE_TIME; - if (needSched && LOS_CHECK_SCHEDULE) { + if (LOS_CHECK_SCHEDULE) { HalTaskSchedule(); } else { - OsTimeSliceUpdate(g_losTask.runTask, g_tickStartTime); - OsSchedUpdateExpireTime(g_tickStartTime, TRUE); + OsSchedUpdateExpireTime(g_losTask.runTask->startTime, TRUE); } LOS_IntRestore(intSave);