aboutsummaryrefslogtreecommitdiff
path: root/src/sched/roundrobin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sched/roundrobin.cpp')
-rw-r--r--src/sched/roundrobin.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/sched/roundrobin.cpp b/src/sched/roundrobin.cpp
deleted file mode 100644
index c3d6cb6..0000000
--- a/src/sched/roundrobin.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "../sched.hpp"
-
-/// Each task is run for a time quantum or the remainder of its cpu burst
-Task *
-RoundRobinQueue::next(int slice)
-{
- if (head == nullptr) return nullptr;
- if (head->node->burst <= 0) {
- delete head->node;
- remove(head->node);
- return next(slice);
- }
-
- auto *it = head;
- it->node->burst -= slice;
- if (head->next) head = head->next;
- it->next = nullptr;
- tail->next = it;
- tail = it;
- return it->node;
-}