pub fn sender(&self) -> AddressSender<A> {
        // this code same as Sender::clone
        let mut curr = self.inner.num_senders.load(SeqCst);

        loop {
            // If the maximum number of senders has been reached, then fail
            if curr == self.inner.max_senders() {
                panic!("cannot clone `Sender` -- too many outstanding senders");
            }

            let next = curr + 1;
            let actual = self.inner.num_senders.compare_and_swap(curr, next, SeqCst);

            // The ABA problem doesn't matter here. We only care that the
            // number of senders never exceeds the maximum.
            if actual == curr {
                return AddressSender {
                    inner: Arc::clone(&self.inner),
                    sender_task: Arc::new(Mutex::new(SenderTask::new())),
                    maybe_parked: Arc::new(AtomicBool::new(false)),
                };
            }

            curr = actual;
        }
    }
/// Get sender side of the channel
Get sender side of the channel
Get sender side of the channel
pub fn sender(&self) -> AddressSender<A> {
        // this code same as Sender::clone
        let mut curr = self.inner.num_senders.load(SeqCst);
        loop {
            // If the maximum number of senders has been reached, then fail
            if curr == self.inner.max_senders() {
                panic!("cannot clone `Sender` -- too many outstanding senders");
            }
            let next = curr + 1;
            let actual = self.inner.num_senders.compare_and_swap(curr, next, SeqCst);
            // The ABA problem doesn't matter here. We only care that the
            // number of senders never exceeds the maximum.
            if actual == curr {
                return AddressSender {
                    inner: Arc::clone(&self.inner),
                    sender_task: Arc::new(Mutex::new(SenderTask::new())),
                    maybe_parked: Arc::new(AtomicBool::new(false)),
                };
            }
            curr = actual;
        }
    }
pub fn sender ( & self ) -> AddressSender < A > { // this code same as Sender::clone let mut curr = self . inner . num_senders . load ( SeqCst ) ; loop { // If the maximum number of senders has been reached, then fail if curr == self . inner . max_senders ( ) { panic ! ( " " ) ; } let next = curr + 1 ; let actual = self . inner . num_senders . compare_and_swap ( curr , next , SeqCst ) ; // The ABA problem doesn't matter here. We only care that the // number of senders never exceeds the maximum. if actual == curr { return AddressSender { inner : Arc :: clone ( & self . inner ) , sender_task : Arc :: new ( Mutex :: new ( SenderTask :: new ( ) ) ) , maybe_parked : Arc :: new ( AtomicBool :: new ( false ) ) , } ; } curr = actual ; } }
Get sender side of the channel
Get sender side of the channel
&self
&self