aboutsummaryrefslogtreecommitdiff
path: root/src/proc/sched.rs
blob: 8e86c7f88e487001ad0f08a93cc6e31b3adb242e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::proc::task::*;
use alloc::collections::linked_list::LinkedList;
// TODO the lifetime here is pretty much broken. Fix this later
pub struct Scheduler<'a> {
	run_list: LinkedList<&'a Task>,
}

impl<'a> Scheduler<'a> {
	#[inline]
	pub fn pop_front(&mut self) -> Option<&Task> {
		self.run_list.pop_front()
	}
	#[inline]
	pub fn push_back(&mut self, t: &'a Task) {
		self.run_list.push_back(t);
	}
}