unsafe fn sender_with_waker(&mut self, state: usize, waker: Option<Waker>) -> Sender<T> {
        // Only create a sender if there is no live sender.
        debug_assert!(state & OPEN == 0);

        // If there is an unread value, drop it.
        if state & EMPTY == 0 {
            // Safety: the presence of an initialized value was just
            // checked and there is no risk of race since there is no live
            // sender.
            self.inner.as_ref().drop_value_in_place();
        }

        // Set the waker in slot 0.
        self.inner.as_ref().set_waker(0, waker);

        // Open the channel and set the current waker slot index to 0.
        //
        // Ordering: since the sender is created right now on this thread,
        // Relaxed ordering is sufficient.
        self.inner
            .as_ref()
            .state
            .store(OPEN | EMPTY, Ordering::Relaxed);

        Sender {
            inner: self.inner,
            _phantom: PhantomData,
        }
    }
/// Initialize the waker in slot 0, set the state to `OPEN | EMPTY` and
/// return a sender.
///
/// Safety: `inner` must be allocated. The sender must have been consumed
/// and all memory operations by the sender on the value and on the waker
/// must be visible in this thread.
Initialize the waker in slot 0, set the state to `OPEN | EMPTY` and
return a sender.

`inner` must be allocated. The sender must have been consumed
and all memory operations by the sender on the value and on the waker
must be visible in this thread.
Initialize the waker in slot 0 set the state to ` OPEN | EMPTY ` and return a sender . ` inner ` must be allocated . The sender must have been consumed and all memory operations by the sender on the value and on the waker must be visible in this thread .
unsafe fn sender_with_waker(&mut self, state: usize, waker: Option<Waker>) -> Sender<T> {
        // Only create a sender if there is no live sender.
        debug_assert!(state & OPEN == 0);
        // If there is an unread value, drop it.
        if state & EMPTY == 0 {
            // Safety: the presence of an initialized value was just
            // checked and there is no risk of race since there is no live
            // sender.
            self.inner.as_ref().drop_value_in_place();
        }
        // Set the waker in slot 0.
        self.inner.as_ref().set_waker(0, waker);
        // Open the channel and set the current waker slot index to 0.
        //
        // Ordering: since the sender is created right now on this thread,
        // Relaxed ordering is sufficient.
        self.inner
            .as_ref()
            .state
            .store(OPEN | EMPTY, Ordering::Relaxed);
        Sender {
            inner: self.inner,
            _phantom: PhantomData,
        }
    }
unsafe fn sender_with_waker ( & mut self , state : usize , waker : Option < Waker > ) -> Sender < T > { // Only create a sender if there is no live sender. debug_assert ! ( state OPEN 0 ) ; // If there is an unread value, drop it. if state & EMPTY == 0 { // Safety: the presence of an initialized value was just // checked and there is no risk of race since there is no live // sender. self . inner . as_ref ( ) . drop_value_in_place ( ) ; } // Set the waker in slot 0. self . inner . as_ref ( ) . set_waker ( 0 , waker ) ; // Open the channel and set the current waker slot index to 0. // // Ordering: since the sender is created right now on this thread, // Relaxed ordering is sufficient. self . inner . as_ref ( ) . state . store ( OPEN | EMPTY , Ordering :: Relaxed ) ; Sender { inner : self . inner , _phantom : PhantomData , } }
Initialize the waker in slot 0, set the state to `OPEN | EMPTY` and
return a sender.
Initialize the waker in slot 0 set the state to ` OPEN | EMPTY ` and return a sender .
&mut self
state
usize
waker
Option<Waker>