You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/12/14 09:25:42 UTC

[GitHub] [incubator-nuttx] zhaoxiu-zeng commented on a change in pull request #4989: sched: fix bug in the function nxsched_resume_scheduler

zhaoxiu-zeng commented on a change in pull request #4989:
URL: https://github.com/apache/incubator-nuttx/pull/4989#discussion_r768463775



##########
File path: sched/sched/sched_addreadytorun.c
##########
@@ -158,6 +169,17 @@ bool nxsched_add_readytorun(FAR struct tcb_s *btcb)
   int cpu;
   int me;
 
+#if CONFIG_RR_INTERVAL > 0
+#ifdef CONFIG_SCHED_SPORADIC
+  if ((btcb->flags & TCB_FLAG_POLICY_MASK) == TCB_FLAG_SCHED_RR)
+#endif
+    {
+      /* Reset the task's timeslice. */
+
+      btcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL);

Review comment:
       When a task is added to ready queue, the task is at the end of the same priority. When the task runs again, a long time has passed. So we re-assign the longest-timeslice to the task. @xiaoxiang781216




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org