unsafe fn poll_swap_active<'a>(
        &self,
        cx: &Context<'_>,
        alternate: &mut *mut WakeSet,
    ) -> Poll<(bool, &'a mut BitSet)> {
        let non_empty = {
            let alternate = (**alternate).as_mut_set();
            let non_empty = !alternate.is_empty();

            // We always force a swap if the capacity has changed, because then
            // we expect subtasks to poll the swapped in set since they were
            // newly added.
            if non_empty {
                return Poll::Ready((true, alternate));
            }

            // Note: We must swap the waker before we swap the set.
            if !self.waker.swap(cx.waker()) {
                return Poll::Pending;
            }

            non_empty
        };

        let wake_set = self.swap_active(alternate);
        Poll::Ready((non_empty, wake_set))
    }
/// Swap the active wake set with the alternate one.
/// Also makes sure that the capacity of the active bitset is updated if the
/// alternate one has.
///
/// # Safety
///
/// Caller must be assured that they are the only one who is attempting to
/// swap out the wake sets.
Swap the active wake set with the alternate one.
Also makes sure that the capacity of the active bitset is updated if the
alternate one has.
Swap the active wake set with the alternate one . Also makes sure that the capacity of the active bitset is updated if the alternate one has .
unsafe fn poll_swap_active<'a>(
        &self,
        cx: &Context<'_>,
        alternate: &mut *mut WakeSet,
    ) -> Poll<(bool, &'a mut BitSet)> {
        let non_empty = {
            let alternate = (**alternate).as_mut_set();
            let non_empty = !alternate.is_empty();
            // We always force a swap if the capacity has changed, because then
            // we expect subtasks to poll the swapped in set since they were
            // newly added.
            if non_empty {
                return Poll::Ready((true, alternate));
            }
            // Note: We must swap the waker before we swap the set.
            if !self.waker.swap(cx.waker()) {
                return Poll::Pending;
            }
            non_empty
        };
        let wake_set = self.swap_active(alternate);
        Poll::Ready((non_empty, wake_set))
    }
unsafe fn poll_swap_active < ' a > ( & self , cx : & Context < ' _ > , alternate : & mut * mut WakeSet , ) -> Poll < ( bool , & ' a mut BitSet ) > { let non_empty = { let alternate = ( * * alternate ) . as_mut_set ( ) ; let non_empty = ! alternate . is_empty ( ) ; // We always force a swap if the capacity has changed, because then // we expect subtasks to poll the swapped in set since they were // newly added. if non_empty { return Poll :: Ready ( ( true , alternate ) ) ; } // Note: We must swap the waker before we swap the set. if ! self . waker . swap ( cx . waker ( ) ) { return Poll :: Pending ; } non_empty } ; let wake_set = self . swap_active ( alternate ) ; Poll :: Ready ( ( non_empty , wake_set ) ) }
Swap the active wake set with the alternate one.
Swap the active wake set with the alternate one .
&self
cx
&Context<'_>
alternate
&mut *mut WakeSet
&self
cx
&Context<'_>
alternate
&mut *mut WakeSet
safety
Caller must be assured that they are the only one who is attempting to
swap out the wake sets.
Caller must be assured that they are the only one who is attempting to swap out the wake sets .