/// Wait on the futex at the given address.
///
/// See FUTEX_WAIT.
Wait on the futex at the given address.
Wait on the futex at the given address .
pub fn wait(
        &self,
        task: &Task,
        addr: UserAddress,
        value: u32,
        mask: u32,
        deadline: zx::Time,
    ) -> Result<(), Errno> {
        let user_current = UserRef::<u32>::new(addr);
        let mut current = 0;
        let waiter = Waiter::new();
        {
            let waiters = self.get_waiters(addr);
            let mut waiters = waiters.lock();
            // TODO: This read should be atomic.
            task.mm.read_object(user_current, &mut current)?;
            if current != value {
                return Ok(());
            }
            waiters.wait_async_mask(&waiter, mask, WaitCallback::none());
        }
        waiter.wait_until(task, deadline)
    }
pub fn wait ( & self , task : & Task , addr : UserAddress , value : u32 , mask : u32 , deadline : zx :: Time , ) -> Result < ( ) , Errno > { let user_current = UserRef :: < u32 > :: new ( addr ) ; let mut current = 0 ; let waiter = Waiter :: new ( ) ; { let waiters = self . get_waiters ( addr ) ; let mut waiters = waiters . lock ( ) ; // TODO: This read should be atomic. task . mm . read_object ( user_current , & mut current ) ? ; if current != value { return Ok ( ( ) ) ; } waiters . wait_async_mask ( & waiter , mask , WaitCallback :: none ( ) ) ; } waiter . wait_until ( task , deadline ) }
Wait on the futex at the given address.
Wait on the futex at the given address .
&self
task
&Task
addr
UserAddress
value
u32
mask
u32
deadline
zx::Time