diff --git a/src/runtime2/scheduler.rs b/src/runtime2/scheduler.rs index 3bc9c94477458743706ed7f8c32e622a41ef3bd6..14ebc566d0fa252649a9a9a71c91a29a432aad7b 100644 --- a/src/runtime2/scheduler.rs +++ b/src/runtime2/scheduler.rs @@ -208,7 +208,7 @@ impl Scheduler { // Note: we're not handling the public inbox, we're dealing with the // private one! debug_assert!(scheduled.shutting_down); - while let Some(message) = scheduled.ctx.read_next_message() { + while let Some(message) = scheduled.ctx.read_next_message_even_if_not_in_sync() { let target_port_and_round_number = match &message { Message::Data(msg) => Some((msg.data_header.target_port, msg.sync_header.sync_round)), Message::SyncComp(_) => None, @@ -405,11 +405,11 @@ impl Scheduler { // TODO: Remove, this is debugging stuff fn debug(&self, message: &str) { - println!("DEBUG [thrd:{:02} conn: ]: {}", self.scheduler_id, message); + // println!("DEBUG [thrd:{:02} conn: ]: {}", self.scheduler_id, message); } fn debug_conn(&self, conn: ConnectorId, message: &str) { - println!("DEBUG [thrd:{:02} conn:{:02}]: {}", self.scheduler_id, conn.0, message); + // println!("DEBUG [thrd:{:02} conn:{:02}]: {}", self.scheduler_id, conn.0, message); } } @@ -579,6 +579,10 @@ impl ComponentCtx { // TODO: Fix the clone of the data message, entirely unnecessary pub(crate) fn read_next_message(&mut self) -> Option { if !self.is_in_sync { return None; } + return self.read_next_message_even_if_not_in_sync(); + } + + pub(crate) fn read_next_message_even_if_not_in_sync(&mut self) -> Option { if self.inbox_len_read == self.inbox_messages.len() { return None; } // We want to keep data messages in the inbox, because we need to check