From ea12d40caf1301b4a7b6d60a2c599ceff4746c90 Mon Sep 17 00:00:00 2001 From: zhushengle Date: Mon, 13 Dec 2021 11:17:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20tick=E4=B8=AD=E6=96=AD=E5=A4=84=E7=90=86?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=97=A0=E6=8C=82=E8=B5=B7=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=97=B6=E5=BA=94=E6=9B=B4=E6=96=B0=E5=BD=93=E5=89=8D=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E4=BB=BB=E5=8A=A1=E7=9A=84=E6=97=B6=E9=97=B4=E7=89=87?= =?UTF-8?q?,=20=E5=B9=B6=E8=A7=A6=E5=8F=91=E4=B8=80=E6=AC=A1=E8=B0=83?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Close #I4LRZG Signed-off-by: zhushengle Change-Id: I4472fb50c775b832688aa7a555498901a80e2999 --- kernel/src/los_sched.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/src/los_sched.c b/kernel/src/los_sched.c index 8f85c06d..a72bd4df 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); -- GitLab