pub unsafe fn read(&self, token: &mut Token) -> Option<T> {
        if token.list.slot.is_null() {
            // The channel is closed.
            return None;
        }

        let slot = &*(token.list.slot as *const Slot<T>);
        let _guard: Guard = token.list.guard.take().unwrap();

        // Wait until the message becomes ready.
        let backoff = &mut Backoff::new();
        while !slot.ready.load(Ordering::Acquire) {
            backoff.step();
        }

        // Read the message.
        let m = slot.msg.get().read();
        let msg = ManuallyDrop::into_inner(m);
        Some(msg)
    }
/// Reads a message from the channel.
Reads a message from the channel.
Reads a message from the channel .
pub unsafe fn read(&self, token: &mut Token) -> Option<T> {
        if token.list.slot.is_null() {
            // The channel is closed.
            return None;
        }
        let slot = &*(token.list.slot as *const Slot<T>);
        let _guard: Guard = token.list.guard.take().unwrap();
        // Wait until the message becomes ready.
        let backoff = &mut Backoff::new();
        while !slot.ready.load(Ordering::Acquire) {
            backoff.step();
        }
        // Read the message.
        let m = slot.msg.get().read();
        let msg = ManuallyDrop::into_inner(m);
        Some(msg)
    }
pub unsafe fn read ( & self , token : & mut Token ) -> Option < T > { if token . list . slot . is_null ( ) { // The channel is closed. return None ; } let slot = & * ( token . list . slot as * const Slot < T > ) ; let _guard : Guard = token . list . guard . take ( ) . unwrap ( ) ; // Wait until the message becomes ready. let backoff = & mut Backoff :: new ( ) ; while ! slot . ready . load ( Ordering :: Acquire ) { backoff . step ( ) ; } // Read the message. let m = slot . msg . get ( ) . read ( ) ; let msg = ManuallyDrop :: into_inner ( m ) ; Some ( msg ) }
Reads a message from the channel.
Reads a message from the channel .
&self
token
&mut Token