diff --git a/src/runtime2/component/component_pdl.rs b/src/runtime2/component/component_pdl.rs index 5a6b6e686dd7b5c95a4527c96c7c8e52dc121dc0..c48b57a00d32408e51cf6dabd5eff7600a550d0c 100644 --- a/src/runtime2/component/component_pdl.rs +++ b/src/runtime2/component/component_pdl.rs @@ -236,7 +236,7 @@ impl Component for CompPDL { sched_ctx.log(&format!("handling message: {:#?}", message)); if let Some(new_target) = self.control.should_reroute(&mut message) { let mut target = sched_ctx.runtime.get_component_public(new_target); - target.send_message(sched_ctx, message, false); // not waking up: we schedule once we've received all PortPeerChanged Acks + target.send_message(&sched_ctx.runtime, message, false); // not waking up: we schedule once we've received all PortPeerChanged Acks let _should_remove = target.decrement_users(); debug_assert!(_should_remove.is_none()); return; @@ -254,6 +254,9 @@ impl Component for CompPDL { }, Message::Sync(message) => { self.handle_incoming_sync_message(sched_ctx, comp_ctx, message); + }, + Message::Poll => { + unreachable!(); // because we never register at the polling thread } } } @@ -502,7 +505,7 @@ impl CompPDL { let port_handle = comp_ctx.get_port_handle(port_id); let (peer, message) = self.control.initiate_port_closing(port_handle, comp_ctx); let peer_info = comp_ctx.get_peer(peer); - peer_info.handle.send_message(sched_ctx, Message::Control(message), true); + peer_info.handle.send_message(&sched_ctx.runtime, Message::Control(message), true); } } @@ -515,7 +518,7 @@ impl CompPDL { let peer_handle = comp_ctx.get_peer_handle(port_info.peer_comp_id); let peer_info = comp_ctx.get_peer(peer_handle); let annotated_message = self.consensus.annotate_data_message(comp_ctx, port_info, value); - peer_info.handle.send_message(sched_ctx, Message::Data(annotated_message), true); + peer_info.handle.send_message(&sched_ctx.runtime, Message::Data(annotated_message), true); } /// Handles a message that came in through the public inbox. This function @@ -563,7 +566,7 @@ impl CompPDL { self.control.initiate_port_blocking(comp_ctx, port_handle); let peer = comp_ctx.get_peer(peer_handle); - peer.handle.send_message(sched_ctx, Message::Control(message), true); + peer.handle.send_message(&sched_ctx.runtime, Message::Control(message), true); } // But we still need to remember the message, so: @@ -598,7 +601,7 @@ impl CompPDL { comp_ctx.set_port_state(port_handle, PortState::Open); let (peer_handle, message) = self.control.cancel_port_blocking(comp_ctx, port_handle); let peer_info = comp_ctx.get_peer(peer_handle); - peer_info.handle.send_message(sched_ctx, Message::Control(message), true); + peer_info.handle.send_message(&sched_ctx.runtime, Message::Control(message), true); } } @@ -625,18 +628,19 @@ impl CompPDL { let mut opened_port_id_pairs = Vec::new(); let mut closed_port_id_pairs = Vec::new(); - // TODO: @Nocommit - let other_proc = &sched_ctx.runtime.protocol.heap[definition_id]; - let self_proc = &sched_ctx.runtime.protocol.heap[self.prompt.frames[0].definition]; - let reservation = sched_ctx.runtime.start_create_pdl_component(); let mut created_ctx = CompCtx::new(&reservation); - println!( - "DEBUG: Comp '{}' (ID {:?}) is creating comp '{}' (ID {:?})", - self_proc.identifier.value.as_str(), creator_ctx.id, - other_proc.identifier.value.as_str(), reservation.id() - ); + let other_proc = &sched_ctx.runtime.protocol.heap[definition_id]; + let self_proc = &sched_ctx.runtime.protocol.heap[self.prompt.frames[0].definition]; + + dbg_code!({ + sched_ctx.log(&format!( + "DEBUG: Comp '{}' (ID {:?}) is creating comp '{}' (ID {:?})", + self_proc.identifier.value.as_str(), creator_ctx.id, + other_proc.identifier.value.as_str(), reservation.id() + )); + }); // Take all the ports ID that are in the `args` (and currently belong to // the creator component) and translate them into new IDs that are @@ -798,7 +802,7 @@ impl CompPDL { ); let peer_handle = created_ctx.get_peer_handle(port_info.peer_comp_id); let peer_info = created_ctx.get_peer(peer_handle); - peer_info.handle.send_message(sched_ctx, message, true); + peer_info.handle.send_message(&sched_ctx.runtime, message, true); } } } else {