fn update_syscallbuf_fds_disabled(&self, mut fd: i32, active_task: &mut dyn Task) {
        debug_assert!(fd >= 0);
        debug_assert!(!self.task_set().is_empty());

        let mut vms_updated: HashSet<AddressSpaceUid> = HashSet::new();

        let mut process = |rt: &mut RecordTask| -> () {
            let vm_uid = rt.vm().uid();
            if !vms_updated.contains(&vm_uid) {
                return;
            }
            vms_updated.insert(vm_uid);

            match rt.preload_globals {
                Some(pg) => {
                    if fd >= SYSCALLBUF_FDS_DISABLED_SIZE {
                        fd = SYSCALLBUF_FDS_DISABLED_SIZE - 1;
                    }
                    let disable: u8 = if is_fd_monitored_in_any_task(&rt.vm(), fd) {
                        1
                    } else {
                        0
                    };

                    let addr: RemotePtr<u8> = RemotePtr::cast(pg)
                        + offset_of!(preload_globals, syscallbuf_fds_disabled)
                        + fd as usize;
                    rt.write_bytes(addr, &disable.to_le_bytes());
                    rt.record_local(addr, &disable.to_le_bytes());
                }
                None => (),
            }
        };

        if active_task.session().is_recording() {
            process(active_task.as_record_task_mut().unwrap());
        } else {
            return;
        }

        // It's possible for tasks with different VMs to share this fd table.
        // But tasks with the same VM might have different fd tables...
        for t in self.task_set().iter_except(active_task.weak_self_ptr()) {
            ed_assert!(active_task, t.borrow().session().is_recording());

            let mut t_ref_task = t.borrow_mut();
            let rt: &mut RecordTask = t_ref_task.as_record_task_mut().unwrap();
            process(rt);
        }
    }
/// DIFF NOTE: Additional param `active_task` to solve borrow issues.
DIFF NOTE: Additional param `active_task` to solve borrow issues.
DIFF NOTE : Additional param ` active_task ` to solve borrow issues .
fn update_syscallbuf_fds_disabled(&self, mut fd: i32, active_task: &mut dyn Task) {
        debug_assert!(fd >= 0);
        debug_assert!(!self.task_set().is_empty());
        let mut vms_updated: HashSet<AddressSpaceUid> = HashSet::new();
        let mut process = |rt: &mut RecordTask| -> () {
            let vm_uid = rt.vm().uid();
            if !vms_updated.contains(&vm_uid) {
                return;
            }
            vms_updated.insert(vm_uid);
            match rt.preload_globals {
                Some(pg) => {
                    if fd >= SYSCALLBUF_FDS_DISABLED_SIZE {
                        fd = SYSCALLBUF_FDS_DISABLED_SIZE - 1;
                    }
                    let disable: u8 = if is_fd_monitored_in_any_task(&rt.vm(), fd) {
                        1
                    } else {
                        0
                    };
                    let addr: RemotePtr<u8> = RemotePtr::cast(pg)
                        + offset_of!(preload_globals, syscallbuf_fds_disabled)
                        + fd as usize;
                    rt.write_bytes(addr, &disable.to_le_bytes());
                    rt.record_local(addr, &disable.to_le_bytes());
                }
                None => (),
            }
        };
        if active_task.session().is_recording() {
            process(active_task.as_record_task_mut().unwrap());
        } else {
            return;
        }
        // It's possible for tasks with different VMs to share this fd table.
        // But tasks with the same VM might have different fd tables...
        for t in self.task_set().iter_except(active_task.weak_self_ptr()) {
            ed_assert!(active_task, t.borrow().session().is_recording());
            let mut t_ref_task = t.borrow_mut();
            let rt: &mut RecordTask = t_ref_task.as_record_task_mut().unwrap();
            process(rt);
        }
    }
fn update_syscallbuf_fds_disabled ( & self , mut fd : i32 , active_task : & mut dyn Task ) { debug_assert ! ( fd 0 ) ; debug_assert ! ( self task_set ( ) is_empty ( ) ) ; let mut vms_updated : HashSet < AddressSpaceUid > = HashSet :: new ( ) ; let mut process = | rt : & mut RecordTask | -> ( ) { let vm_uid = rt . vm ( ) . uid ( ) ; if ! vms_updated . contains ( & vm_uid ) { return ; } vms_updated . insert ( vm_uid ) ; match rt . preload_globals { Some ( pg ) => { if fd >= SYSCALLBUF_FDS_DISABLED_SIZE { fd = SYSCALLBUF_FDS_DISABLED_SIZE - 1 ; } let disable : u8 = if is_fd_monitored_in_any_task ( & rt . vm ( ) , fd ) { 1 } else { 0 } ; let addr : RemotePtr < u8 > = RemotePtr :: cast ( pg ) + offset_of ! ( preload_globals syscallbuf_fds_disabled ) + fd as usize ; rt . write_bytes ( addr , & disable . to_le_bytes ( ) ) ; rt . record_local ( addr , & disable . to_le_bytes ( ) ) ; } None => ( ) , } } ; if active_task . session ( ) . is_recording ( ) { process ( active_task . as_record_task_mut ( ) . unwrap ( ) ) ; } else { return ; } // It's possible for tasks with different VMs to share this fd table. // But tasks with the same VM might have different fd tables... for t in self . task_set ( ) . iter_except ( active_task . weak_self_ptr ( ) ) { ed_assert ! ( active_task t borrow ( ) session ( ) is_recording ( ) ) ; let mut t_ref_task = t . borrow_mut ( ) ; let rt : & mut RecordTask = t_ref_task . as_record_task_mut ( ) . unwrap ( ) ; process ( rt ) ; } }
DIFF NOTE: Additional param `active_task` to solve borrow issues.
DIFF NOTE : Additional param ` active_task ` to solve borrow issues .
&self
fd
i32
active_task
&mut dyn Task