diff --git a/src/runtime2/component/control_layer.rs b/src/runtime2/component/control_layer.rs index 17d575a6a87403c4d4ee81b8b29f8004a42df580..94cd052e5014343afd81807c3f2efe4bc4af2717 100644 --- a/src/runtime2/component/control_layer.rs +++ b/src/runtime2/component/control_layer.rs @@ -126,7 +126,7 @@ impl ControlLayer { let port_handle = comp_ctx.get_port_handle(closed_port); let port_info = comp_ctx.get_port(port_handle); let port_peer_comp_id = port_info.peer_comp_id; - debug_assert_eq!(port_info.state, PortState::Closed); + debug_assert!(port_info.state.is_closed()); comp_ctx.remove_peer(sched_ctx, port_handle, port_peer_comp_id, true); // remove if closed return (AckAction::None, None); @@ -191,7 +191,7 @@ impl ControlLayer { id: entry_id, sender_comp_id: creator_comp_id, target_port_id: Some(source_port_id), - content: ControlMessageContent::PortPeerChangedBlock(source_port_id) + content: ControlMessageContent::PortPeerChangedBlock }) } @@ -218,7 +218,7 @@ impl ControlLayer { pub(crate) fn initiate_port_closing(&mut self, port_handle: LocalPortHandle, exit_inside_sync: bool, comp_ctx: &CompCtx) -> (LocalPeerHandle, ControlMessage) { let port = comp_ctx.get_port(port_handle); let peer_port_id = port.peer_port_id; - debug_assert!(port.state == PortState::Closed); + debug_assert!(port.state.is_closed()); // Construct the port-closing entry let entry_id = self.take_id(); @@ -237,7 +237,6 @@ impl ControlLayer { sender_comp_id: comp_ctx.id, target_port_id: Some(peer_port_id), content: ControlMessageContent::ClosePort(ControlMessageClosePort{ - port_to_close: peer_port_id, closed_in_sync_round: exit_inside_sync, }), } @@ -250,7 +249,7 @@ impl ControlLayer { pub(crate) fn initiate_port_blocking(&mut self, comp_ctx: &CompCtx, port_handle: LocalPortHandle) -> (LocalPeerHandle, ControlMessage) { let port_info = comp_ctx.get_port(port_handle); debug_assert_eq!(port_info.kind, PortKind::Getter); // because we're telling the putter to block - debug_assert_eq!(port_info.state, PortState::BlockedDueToFullBuffers); // contract with caller + debug_assert!(port_info.state.is_set(PortStateFlag::BlockedDueToFullBuffers)); // contract with caller let peer_port_id = port_info.peer_port_id; let peer_comp_id = port_info.peer_comp_id; @@ -261,8 +260,8 @@ impl ControlLayer { ControlMessage{ id: ControlId::new_invalid(), sender_comp_id: comp_ctx.id, - target_port_id: Some(port_info.peer_port_id), - content: ControlMessageContent::BlockPort(peer_port_id), + target_port_id: Some(peer_port_id), + content: ControlMessageContent::BlockPort, } ); } @@ -272,7 +271,6 @@ impl ControlLayer { pub(crate) fn cancel_port_blocking(&mut self, comp_ctx: &CompCtx, port_handle: LocalPortHandle) -> (LocalPeerHandle, ControlMessage) { let port_info = comp_ctx.get_port(port_handle); debug_assert_eq!(port_info.kind, PortKind::Getter); // because we're initiating the unblocking - debug_assert_eq!(port_info.state, PortState::Open); // contract with caller, the locally stored entry ensures we were blocked before let peer_handle = comp_ctx.get_peer_handle(port_info.peer_comp_id); @@ -282,7 +280,7 @@ impl ControlLayer { id: ControlId::new_invalid(), sender_comp_id: comp_ctx.id, target_port_id: Some(port_info.peer_port_id), - content: ControlMessageContent::UnblockPort(port_info.peer_port_id) + content: ControlMessageContent::UnblockPort, } ); }