[freenos] r418 committed - Fix in scheduler: continue with current process if still ready, instea...

  • From: freenos@xxxxxxxxxxxxxx
  • To: freenos@xxxxxxxxxxxxx
  • Date: Fri, 22 Oct 2010 22:42:27 +0000

Revision: 418
Author: nieklinnenbank
Date: Fri Oct 22 15:41:50 2010
Log: Fix in scheduler: continue with current process if still ready, instead of idle.

http://code.google.com/p/freenos/source/detail?r=418

Modified:
 /branches/scratch/system/process.c

=======================================
--- /branches/scratch/system/process.c  Fri Oct 22 15:10:20 2010
+++ /branches/scratch/system/process.c  Fri Oct 22 15:41:50 2010
@@ -197,10 +197,13 @@
     {
        last_pid = (last_pid + 1) % PROC_MAX;

-       /* Fall back to the idle process if nobody ready. */
+       /* Fall back to the current or idle process if nobody ready. */
        if (last_pid == start)
        {
-           new = smp_cpu()->idle;
+           if (old && old->flags & PROC_READY)
+               new = old;
+           else
+               new = smp_cpu()->idle;
            break;
        }
        /*

Other related posts:

  • » [freenos] r418 committed - Fix in scheduler: continue with current process if still ready, instea... - freenos