fn sleep(&self, waker: &Waker) -> bool {
        let mut sleepers = self.global.sleepers.lock().unwrap();
        match self.sleeping.load(Ordering::SeqCst) {
            // Move to sleeping state.
            0 => self
                .sleeping
                .store(sleepers.insert(waker), Ordering::SeqCst),
            id => {
                // Already sleeping, check if notified.
                if !sleepers.update(id, waker) {
                    return false;
                }
            }
        }
        self.global
            .notified
            .swap(sleepers.is_notified(), Ordering::SeqCst);
        true
    }
/// Moves the ticker into sleeping and unnotified state.
///
/// Returns `false` if the ticker was already sleeping and unnotified.
Moves the ticker into sleeping and unnotified state.
Returns `false` if the ticker was already sleeping and unnotified.
Moves the ticker into sleeping and unnotified state . Returns ` false ` if the ticker was already sleeping and unnotified .
fn sleep(&self, waker: &Waker) -> bool {
        let mut sleepers = self.global.sleepers.lock().unwrap();
        match self.sleeping.load(Ordering::SeqCst) {
            // Move to sleeping state.
            0 => self
                .sleeping
                .store(sleepers.insert(waker), Ordering::SeqCst),
            id => {
                // Already sleeping, check if notified.
                if !sleepers.update(id, waker) {
                    return false;
                }
            }
        }
        self.global
            .notified
            .swap(sleepers.is_notified(), Ordering::SeqCst);
        true
    }
fn sleep ( & self , waker : & Waker ) -> bool { let mut sleepers = self . global . sleepers . lock ( ) . unwrap ( ) ; match self . sleeping . load ( Ordering :: SeqCst ) { // Move to sleeping state. 0 => self . sleeping . store ( sleepers . insert ( waker ) , Ordering :: SeqCst ) , id => { // Already sleeping, check if notified. if ! sleepers . update ( id , waker ) { return false ; } } } self . global . notified . swap ( sleepers . is_notified ( ) , Ordering :: SeqCst ) ; true }
Moves the ticker into sleeping and unnotified state.
Moves the ticker into sleeping and unnotified state .
&self
waker
&Waker
&self
waker
&Waker