fn sweep_killq(&mut self) {
        while let Some(key) = self.killq.pop() {
            // Connections don't get removed from the kill queue when their kill timer is
            // disarmed, since that would be a costly operation. This means we must check if
            // the connection has indeed expired, prior to killing it.
            let mut kill = false;
            self.conn_map
                .entry(key)
                .and_modify(|conn| kill = conn.has_expired());
            if kill {
                self.kill_connection(key);
            }
        }

        if self.killq.is_empty() && !self.killq.is_synced() {
            self.killq = MuxerKillQ::from_conn_map(&self.conn_map);
            METRICS.vsock.killq_resync.inc();
            // If we've just re-created the kill queue, we can sweep it again; maybe there's
            // more to kill.
            self.sweep_killq();
        }
    }
/// Check if any connections have timed out, and if so, schedule them for immediate
/// termination.
Check if any connections have timed out, and if so, schedule them for immediate
termination.
Check if any connections have timed out and if so schedule them for immediate termination .
fn sweep_killq(&mut self) {
        while let Some(key) = self.killq.pop() {
            // Connections don't get removed from the kill queue when their kill timer is
            // disarmed, since that would be a costly operation. This means we must check if
            // the connection has indeed expired, prior to killing it.
            let mut kill = false;
            self.conn_map
                .entry(key)
                .and_modify(|conn| kill = conn.has_expired());
            if kill {
                self.kill_connection(key);
            }
        }
        if self.killq.is_empty() && !self.killq.is_synced() {
            self.killq = MuxerKillQ::from_conn_map(&self.conn_map);
            METRICS.vsock.killq_resync.inc();
            // If we've just re-created the kill queue, we can sweep it again; maybe there's
            // more to kill.
            self.sweep_killq();
        }
    }
fn sweep_killq ( & mut self ) { while let Some ( key ) = self . killq . pop ( ) { // Connections don't get removed from the kill queue when their kill timer is // disarmed, since that would be a costly operation. This means we must check if // the connection has indeed expired, prior to killing it. let mut kill = false ; self . conn_map . entry ( key ) . and_modify ( | conn | kill = conn . has_expired ( ) ) ; if kill { self . kill_connection ( key ) ; } } if self . killq . is_empty ( ) && ! self . killq . is_synced ( ) { self . killq = MuxerKillQ :: from_conn_map ( & self . conn_map ) ; METRICS . vsock . killq_resync . inc ( ) ; // If we've just re-created the kill queue, we can sweep it again; maybe there's // more to kill. self . sweep_killq ( ) ; } }
Check if any connections have timed out, and if so, schedule them for immediate
termination.
Check if any connections have timed out and if so schedule them for immediate termination .
&mut self
&mut self