fn prepare_for_sleep(&self) -> bool {
        let end_marker = self.inner.end_marker();
        let sleep_marker = self.inner.sleep_marker();

        self.inner.sleep_marker.next_readiness.store(ptr::null_mut(), Relaxed);

        let actual = self.inner.head_readiness.compare_and_swap(
            end_marker, sleep_marker, AcqRel);

        debug_assert!(actual != sleep_marker);

        if actual != end_marker {
            // The readiness queue is not empty
            return false;
        }

        // The current tail should be pointing to `end_marker`
        debug_assert!(unsafe { *self.inner.tail_readiness.get() == end_marker });
        // The `end_marker` next pointer should be null
        debug_assert!(self.inner.end_marker.next_readiness.load(Relaxed).is_null());

        // Update tail pointer.
        unsafe { *self.inner.tail_readiness.get() = sleep_marker; }
        true
    }
/// Prepare the queue for the `Poll::poll` thread to block in the system
/// selector. This involves changing `head_readiness` to `sleep_marker`.
/// Returns true if successfull and `poll` can block.
Prepare the queue for the `Poll::poll` thread to block in the system
selector.
Prepare the queue for the ` Poll :: poll ` thread to block in the system selector .
fn prepare_for_sleep(&self) -> bool {
        let end_marker = self.inner.end_marker();
        let sleep_marker = self.inner.sleep_marker();
        self.inner.sleep_marker.next_readiness.store(ptr::null_mut(), Relaxed);
        let actual = self.inner.head_readiness.compare_and_swap(
            end_marker, sleep_marker, AcqRel);
        debug_assert!(actual != sleep_marker);
        if actual != end_marker {
            // The readiness queue is not empty
            return false;
        }
        // The current tail should be pointing to `end_marker`
        debug_assert!(unsafe { *self.inner.tail_readiness.get() == end_marker });
        // The `end_marker` next pointer should be null
        debug_assert!(self.inner.end_marker.next_readiness.load(Relaxed).is_null());
        // Update tail pointer.
        unsafe { *self.inner.tail_readiness.get() = sleep_marker; }
        true
    }
fn prepare_for_sleep ( & self ) -> bool { let end_marker = self . inner . end_marker ( ) ; let sleep_marker = self . inner . sleep_marker ( ) ; self . inner . sleep_marker . next_readiness . store ( ptr :: null_mut ( ) , Relaxed ) ; let actual = self . inner . head_readiness . compare_and_swap ( end_marker , sleep_marker , AcqRel ) ; debug_assert ! ( actual sleep_marker ) ; if actual != end_marker { // The readiness queue is not empty return false ; } // The current tail should be pointing to `end_marker` debug_assert ! ( unsafe { self inner tail_readiness get ( ) end_marker } ) ; // The `end_marker` next pointer should be null debug_assert ! ( self inner end_marker next_readiness load ( Relaxed ) is_null ( ) ) ; // Update tail pointer. unsafe { * self . inner . tail_readiness . get ( ) = sleep_marker ; } true }
Prepare the queue for the `Poll::poll` thread to block in the system
selector.
Prepare the queue for the ` Poll :: poll ` thread to block in the system selector .
&self