diff --git a/src/kernel/scheduler.rs b/src/kernel/scheduler.rs index e69de29..34f81f9 100644 --- a/src/kernel/scheduler.rs +++ b/src/kernel/scheduler.rs @@ -0,0 +1,32 @@ +use crate::utility::list::List; +use crate::kernel::thread::Thread; +use std::rc::Rc; + + +struct Scheduler<> { + ready_list: List> +} + +impl Scheduler { + + /// Constructor + /// + /// Initilize the list of ready thread + pub fn new() -> Self { + Self { + ready_list: List::new() + } + } + + /// Mark a thread as aready, but not necessarily running yet. + /// + /// Put it in the ready list, for later scheduling onto the CPU. + /// + /// ## Pamameter + /// + /// **thread**: Thread is the thread to be put on the read list + pub fn ready_to_run(&mut self, thread: Rc) { + self.ready_list.push_back(thread); + } + +} \ No newline at end of file