diff --git a/src/runtime2/scheduler.rs b/src/runtime2/scheduler.rs index 87bdb80e316c95be1016a1347b9f6c5aaaaba5fa..708d4c9ec6571ce57cc104abb50d84ae80f71920 100644 --- a/src/runtime2/scheduler.rs +++ b/src/runtime2/scheduler.rs @@ -1,5 +1,6 @@ use std::sync::Arc; use std::sync::atomic::Ordering; +use crate::runtime2::poll::PollingClient; use super::component::*; use super::runtime::*; @@ -7,21 +8,24 @@ use super::runtime::*; /// Data associated with a scheduler thread pub(crate) struct Scheduler { runtime: Arc, + polling: PollingClient, scheduler_id: u32, debug_logging: bool, } pub(crate) struct SchedulerCtx<'a> { pub runtime: &'a RuntimeInner, + pub polling: &'a PollingClient, pub id: u32, pub comp: u32, pub logging_enabled: bool, } impl<'a> SchedulerCtx<'a> { - pub fn new(runtime: &'a RuntimeInner, id: u32, logging_enabled: bool) -> Self { + pub fn new(runtime: &'a RuntimeInner, polling: &'a PollingClient, id: u32, logging_enabled: bool) -> Self { return Self { runtime, + polling, id, comp: 0, logging_enabled, @@ -38,12 +42,12 @@ impl<'a> SchedulerCtx<'a> { impl Scheduler { // public interface to thread - pub fn new(runtime: Arc, scheduler_id: u32, debug_logging: bool) -> Self { - return Scheduler{ runtime, scheduler_id, debug_logging } + pub fn new(runtime: Arc, polling: PollingClient, scheduler_id: u32, debug_logging: bool) -> Self { + return Scheduler{ runtime, polling, scheduler_id, debug_logging } } pub fn run(&mut self) { - let mut scheduler_ctx = SchedulerCtx::new(&*self.runtime, self.scheduler_id, self.debug_logging); + let mut scheduler_ctx = SchedulerCtx::new(&*self.runtime, &self.polling, self.scheduler_id, self.debug_logging); 'run_loop: loop { // Wait until we have something to do (or need to quit)