fix the dumb

master
MunirG05 2023-07-11 13:30:45 +05:30
parent 1d5bb220ec
commit e3f6295997
1 changed files with 0 additions and 14 deletions

View File

@ -7,9 +7,6 @@ use {crate::host::TrapHandler, hbvm::vm::Vm};
pub struct Scheduler<'a> {
data: VecDeque<Vm<'a, TrapHandler>>,
pub tick_callback: Option<fn() -> u64>,
pub last_timer_count: u64,
pub tick_limit: u64,
}
// NOTE: This is a very simple schduler and it sucks and should be replaced with a better one
@ -51,16 +48,5 @@ impl Scheduler<'_> {
let mut prog = self.data.pop_front().unwrap();
prog.run().unwrap();
self.data.push_back(prog);
if self.tick_callback.is_some() {
let ret = self.tick_callback.unwrap()();
if (ret - self.last_timer_count) >= self.tick_limit {
return Some(0);
}
}
break;
}
Some(1)
}
}