From a5594f90afa6cb2f56187ce0358c4ae961ef9035 2022-03-23 14:29:24 From: mh Date: 2022-03-23 14:29:24 Subject: [PATCH] Fix bug in select statement --- diff --git a/src/runtime2/component/component_ip.rs b/src/runtime2/component/component_ip.rs index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9f63e10b2f4b5b173c8b5b0b1da36f46e4acf710 100644 --- a/src/runtime2/component/component_ip.rs +++ b/src/runtime2/component/component_ip.rs @@ -0,0 +1,22 @@ +use crate::protocol::eval::*; +use crate::runtime2::*; +use super::*; + +/// TODO: Temporary component to figure out what to do with custom components. +/// This component sends random numbers between two u32 limits +struct ComponentRandSend { +} + +impl Component for ComponentRandSend { + fn adopt_message(&mut self, _comp_ctx: &mut CompCtx, _message: DataMessage) { + unreachable!("should not adopt messages"); + } + + fn handle_message(&mut self, sched_ctx: &mut SchedulerCtx, comp_ctx: &mut CompCtx, message: Message) { + todo!() + } + + fn run(&mut self, sched_ctx: &mut SchedulerCtx, comp_ctx: &mut CompCtx) -> Result { + todo!() + } +} \ No newline at end of file diff --git a/src/runtime2/component/component_pdl.rs b/src/runtime2/component/component_pdl.rs index 6486b1c87a6d42a94cc1cd75d577e4e036523d1b..efd6a121c7e84aa016d9121884a82707feca2671 100644 --- a/src/runtime2/component/component_pdl.rs +++ b/src/runtime2/component/component_pdl.rs @@ -285,10 +285,10 @@ impl Component for CompPDL { // Depending on the mode don't do anything at all, take some special // actions, or fall through and run the PDL code. match self.mode { - Mode::NonSync | Mode::Sync | Mode::BlockedSelect => { + Mode::NonSync | Mode::Sync => { // continue and run PDL code }, - Mode::SyncEnd | Mode::BlockedGet | Mode::BlockedPut => { + Mode::SyncEnd | Mode::BlockedGet | Mode::BlockedPut | Mode::BlockedSelect => { return Ok(CompScheduling::Sleep); } Mode::StartExit => { diff --git a/src/runtime2/component/mod.rs b/src/runtime2/component/mod.rs index 3b34d472f560a256641693c1d22ea24e77edc60a..d5f0016f42f5f6714cb03641d63a8d7f1140acbb 100644 --- a/src/runtime2/component/mod.rs +++ b/src/runtime2/component/mod.rs @@ -3,6 +3,7 @@ mod component_context; mod control_layer; mod consensus; mod component; +mod component_ip; pub(crate) use component::{Component, CompScheduling}; pub(crate) use component_pdl::{CompPDL};