async fn dying_run<F, T, FT>(&self, future: F) -> ZxResult<T>
    where
        F: Future<Output = FT> + Unpin,
        FT: IntoResult<T>,
    {
        let killed = {
            let mut inner = self.inner.lock();
            if inner.killed {
                return Err(ZxError::STOP);
            }
            let (sender, receiver) = channel::<()>();
            inner.killer = Some(sender);
            receiver
        };
        select_biased! {
            ret = future.fuse() => ret.into_result(),
            _ = killed.fuse() => Err(ZxError::STOP),
        }
    }
/// Run a blocking task when the thread is exited itself and dying.
///
/// The task will stop running if and once the thread is killed.
Run a blocking task when the thread is exited itself and dying.
The task will stop running if and once the thread is killed.
Run a blocking task when the thread is exited itself and dying . The task will stop running if and once the thread is killed .
async fn dying_run<F, T, FT>(&self, future: F) -> ZxResult<T>
    where
        F: Future<Output = FT> + Unpin,
        FT: IntoResult<T>,
    {
        let killed = {
            let mut inner = self.inner.lock();
            if inner.killed {
                return Err(ZxError::STOP);
            }
            let (sender, receiver) = channel::<()>();
            inner.killer = Some(sender);
            receiver
        };
        select_biased! {
            ret = future.fuse() => ret.into_result(),
            _ = killed.fuse() => Err(ZxError::STOP),
        }
    }
async fn dying_run < F , T , FT > ( & self , future : F ) -> ZxResult < T > where F : Future < Output = FT > + Unpin , FT : IntoResult < T > , { let killed = { let mut inner = self . inner . lock ( ) ; if inner . killed { return Err ( ZxError :: STOP ) ; } let ( sender , receiver ) = channel :: < ( ) > ( ) ; inner . killer = Some ( sender ) ; receiver } ; select_biased ! { ret future fuse ( ) ret into_result ( ) killed fuse ( ) Err ( ZxError STOP ) } }
Run a blocking task when the thread is exited itself and dying.
Run a blocking task when the thread is exited itself and dying .
&self
future
F
&self
future
F