diff --git a/src/runtime2/mod.rs b/src/runtime2/mod.rs index 32b1be9a1b059aa7e1b4c2aef2380acd93708848..2622104e2d5aa40d557ffa26ec7c5fc44cd8908d 100644 --- a/src/runtime2/mod.rs +++ b/src/runtime2/mod.rs @@ -24,7 +24,7 @@ use inbox::Message; use connector::{ConnectorPDL, ConnectorPublic, ConnectorScheduling, RunDeltaState}; use scheduler::{Scheduler, ConnectorCtx, ControlMessageHandler}; use native::{Connector, ConnectorApplication, ApplicationInterface}; -use crate::runtime2::port::Port; +use crate::runtime2::port::{Port, PortState}; use crate::runtime2::scheduler::SchedulerCtx; /// A kind of token that, once obtained, allows mutable access to a connector. @@ -231,12 +231,14 @@ impl RuntimeInner { self_id: getter_id, peer_id: putter_id, kind: PortKind::Getter, + state: PortState::Open, peer_connector: creating_connector, }; let putter_port = Port{ self_id: putter_id, peer_id: getter_id, kind: PortKind::Putter, + state: PortState::Open, peer_connector: creating_connector, }; @@ -289,7 +291,7 @@ impl RuntimeInner { ConnectorVariant::UserDefined(connector) => { for port_id in connector.ports.owned_ports.iter().copied() { println!("DEBUG: Transferring port {:?} from {} to {}", port_id, created_by.context.id.0, key.index); - let mut port = created_by.context.remove_port(port_id); + let port = created_by.context.remove_port(port_id); created.context.add_port(port); } }, @@ -350,7 +352,7 @@ impl RuntimeInner { let old_num = self.active_connectors.fetch_sub(1, Ordering::SeqCst); println!("DEBUG: Decremented components to {}", old_num - 1); debug_assert!(old_num > 0); - if old_num == 0 { // such that we have no more active connectors (for now!) + if old_num == 1 { // such that we have no more active connectors (for now!) let num_interfaces = self.active_interfaces.load(Ordering::Acquire); if num_interfaces == 0 { self.signal_for_shutdown(); @@ -428,7 +430,6 @@ impl ConnectorStore { public: ConnectorPublic::new(initially_sleeping), router: ControlMessageHandler::new(), shutting_down: false, - pending_acks: 0, }; let index;