Skip to content

Commit

Permalink
sched: process scheduler before wd_timer handler
Browse files Browse the repository at this point in the history
wd_timer handler will change current task, so need process
scheduler before wd timer handler, Ensure that the current
task is not updated before the RR process

Signed-off-by: zhangyuan29 <[email protected]>
  • Loading branch information
zyfeier committed Oct 2, 2024
1 parent b2e69b8 commit 32eccb5
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions sched/sched/sched_timerexpiration.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,26 +347,23 @@ static clock_t nxsched_timer_process(clock_t ticks, clock_t elapsed,
nxsched_process_cpuload_ticks(elapsed);
#endif

/* Process watchdogs */
/* Check for operations specific to scheduling policy of the currently
* active task.
*/

tmp = wd_timer(ticks, noswitches);
tmp = nxsched_process_scheduler(ticks, elapsed, noswitches);
if (tmp > 0)
{
rettime = tmp;
}

/* Check for operations specific to scheduling policy of the currently
* active task.
*/

tmp = nxsched_process_scheduler(ticks, elapsed, noswitches);
/* Process watchdogs */

#if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC)
tmp = wd_timer(ticks, noswitches);
if (tmp > 0 && (rettime == 0 || tmp < rettime))
{
rettime = tmp;
}
#endif

return rettime;
}
Expand Down

0 comments on commit 32eccb5

Please sign in to comment.