Skip to content
Snippets Groups Projects
Commit 7f607dcb authored by sfphoton's avatar sfphoton
Browse files

Bugfix: Fixed selection of active task when RR is restarted.

parent e13863ab
Branches
No related tags found
No related merge requests found
...@@ -14,7 +14,6 @@ public class Global { ...@@ -14,7 +14,6 @@ public class Global {
if (t.isKernel) { if (t.isKernel) {
srtf.add(t); srtf.add(t);
rr.stop();
} else { } else {
rr.add(t); rr.add(t);
} }
...@@ -22,6 +21,7 @@ public class Global { ...@@ -22,6 +21,7 @@ public class Global {
public void tick() { public void tick() {
if(srtf.isEmpty() && rr.isEmpty()) {Main.schedulersEmpty = true; return;} if(srtf.isEmpty() && rr.isEmpty()) {Main.schedulersEmpty = true; return;}
else if(!srtf.isEmpty()) rr.stop();
srtf.tick(); srtf.tick();
rr.tick(); rr.tick();
......
...@@ -21,17 +21,14 @@ public class RR { ...@@ -21,17 +21,14 @@ public class RR {
} }
public void start() { public void start() {
if(!enabled) {
if (activeTask != null) waitingQueue.add(activeTask);
activeTask = null;
}
enabled = true; enabled = true;
} }
public void stop() { public void stop() {
enabled = false; enabled = false;
runningFor = 0; runningFor = 0;
if (activeTask != null) waitingQueue.add(activeTask);
activeTask = null;
} }
public void add(Task t) { public void add(Task t) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment