pub async fn sys_object_wait_many(
        &self,
        mut user_items: UserInOutPtr<UserWaitItem>,
        count: u32,
        deadline: Deadline,
    ) -> ZxResult {
        if count > MAX_WAIT_MANY_ITEMS {
            return Err(ZxError::OUT_OF_RANGE);
        }
        let mut items = user_items.read_array(count as usize)?;
        info!("user_items: {:#x?}, deadline: {:?}", user_items, deadline);
        let proc = self.thread.proc();
        let mut waiters = Vec::with_capacity(count as usize);
        for item in items.iter() {
            let object = proc.get_dyn_object_with_rights(item.handle, Rights::WAIT)?;
            waiters.push((object, item.wait_for));
        }
        let future = wait_signal_many(&waiters);
        let res = self
            .thread
            .blocking_run(future, ThreadState::BlockedWaitMany, deadline.into(), None)
            .await?;
        for (i, item) in items.iter_mut().enumerate() {
            item.observed = res[i];
        }
        user_items.write_array(&items)?;
        Ok(())
    }
/// Wait for signals on multiple objects.
Wait for signals on multiple objects.
Wait for signals on multiple objects .
pub async fn sys_object_wait_many(
        &self,
        mut user_items: UserInOutPtr<UserWaitItem>,
        count: u32,
        deadline: Deadline,
    ) -> ZxResult {
        if count > MAX_WAIT_MANY_ITEMS {
            return Err(ZxError::OUT_OF_RANGE);
        }
        let mut items = user_items.read_array(count as usize)?;
        info!("user_items: {:#x?}, deadline: {:?}", user_items, deadline);
        let proc = self.thread.proc();
        let mut waiters = Vec::with_capacity(count as usize);
        for item in items.iter() {
            let object = proc.get_dyn_object_with_rights(item.handle, Rights::WAIT)?;
            waiters.push((object, item.wait_for));
        }
        let future = wait_signal_many(&waiters);
        let res = self
            .thread
            .blocking_run(future, ThreadState::BlockedWaitMany, deadline.into(), None)
            .await?;
        for (i, item) in items.iter_mut().enumerate() {
            item.observed = res[i];
        }
        user_items.write_array(&items)?;
        Ok(())
    }
pub async fn sys_object_wait_many ( & self , mut user_items : UserInOutPtr < UserWaitItem > , count : u32 , deadline : Deadline , ) -> ZxResult { if count > MAX_WAIT_MANY_ITEMS { return Err ( ZxError :: OUT_OF_RANGE ) ; } let mut items = user_items . read_array ( count as usize ) ? ; info ! ( " " user_items deadline ) ; let proc = self . thread . proc ( ) ; let mut waiters = Vec :: with_capacity ( count as usize ) ; for item in items . iter ( ) { let object = proc . get_dyn_object_with_rights ( item . handle , Rights :: WAIT ) ? ; waiters . push ( ( object , item . wait_for ) ) ; } let future = wait_signal_many ( & waiters ) ; let res = self . thread . blocking_run ( future , ThreadState :: BlockedWaitMany , deadline . into ( ) , None ) . await ? ; for ( i , item ) in items . iter_mut ( ) . enumerate ( ) { item . observed = res [ i ] ; } user_items . write_array ( & items ) ? ; Ok ( ( ) ) }
Wait for signals on multiple objects.
Wait for signals on multiple objects .
&self
user_items
UserInOutPtr<UserWaitItem>
count
u32
deadline
Deadline
&self
user_items
UserInOutPtr<UserWaitItem>
count
u32
deadline
Deadline