fn run(self) {
        let Task { mut future, wake_handle, mut exec } = self;
        let waker = waker_ref(&wake_handle);
        let mut cx = Context::from_waker(&waker);

        // Safety: The ownership of this `Task` object is evidence that
        // we are in the `POLLING`/`REPOLL` state for the mutex.
        unsafe {
            wake_handle.mutex.start_poll();

            loop {
                let res = future.poll_unpin(&mut cx);
                match res {
                    Poll::Pending => {}
                    Poll::Ready(()) => return wake_handle.mutex.complete(),
                }
                let task = Task {
                    future,
                    wake_handle: wake_handle.clone(),
                    exec,
                };
                match wake_handle.mutex.wait(task) {
                    Ok(()) => return, // we've waited
                    Err(task) => { // someone's notified us
                        future = task.future;
                        exec = task.exec;
                    }
                }
            }
        }
    }
/// Actually run the task (invoking `poll` on the future) on the current
/// thread.
Actually run the task (invoking `poll` on the future) on the current
thread.
Actually run the task ( invoking ` poll ` on the future ) on the current thread .
fn run(self) {
        let Task { mut future, wake_handle, mut exec } = self;
        let waker = waker_ref(&wake_handle);
        let mut cx = Context::from_waker(&waker);
        // Safety: The ownership of this `Task` object is evidence that
        // we are in the `POLLING`/`REPOLL` state for the mutex.
        unsafe {
            wake_handle.mutex.start_poll();
            loop {
                let res = future.poll_unpin(&mut cx);
                match res {
                    Poll::Pending => {}
                    Poll::Ready(()) => return wake_handle.mutex.complete(),
                }
                let task = Task {
                    future,
                    wake_handle: wake_handle.clone(),
                    exec,
                };
                match wake_handle.mutex.wait(task) {
                    Ok(()) => return, // we've waited
                    Err(task) => { // someone's notified us
                        future = task.future;
                        exec = task.exec;
                    }
                }
            }
        }
    }
fn run ( self ) { let Task { mut future , wake_handle , mut exec } = self ; let waker = waker_ref ( & wake_handle ) ; let mut cx = Context :: from_waker ( & waker ) ; // Safety: The ownership of this `Task` object is evidence that // we are in the `POLLING`/`REPOLL` state for the mutex. unsafe { wake_handle . mutex . start_poll ( ) ; loop { let res = future . poll_unpin ( & mut cx ) ; match res { Poll :: Pending => { } Poll :: Ready ( ( ) ) => return wake_handle . mutex . complete ( ) , } let task = Task { future , wake_handle : wake_handle . clone ( ) , exec , } ; match wake_handle . mutex . wait ( task ) { Ok ( ( ) ) => return , // we've waited Err ( task ) => { // someone's notified us future = task . future ; exec = task . exec ; } } } } }
Actually run the task (invoking `poll` on the future) on the current
thread.
Actually run the task ( invoking ` poll ` on the future ) on the current thread .
self