pub fn notify(&self, value: T) {
        {
            let mut guard = self.mutex.lock().unwrap();
            if let Some(ref old_value) = *guard {
                if value != *old_value {
                    panic!(
                        "Notified twice with different values: first {:?}, then {:?}",
                        old_value, value
                    );
                } else {
                    return;
                }
            }
            *guard = Some(value);
        }
        self.condvar.notify_all();
    }
/// Set the notification to the raised state. Once notification is
/// saturated, it stays saturated forever, there is no way to reset it.
///
/// # Panics
///
/// Panics if `notify` is called twice with different values.
Set the notification to the raised state. Once notification is
saturated, it stays saturated forever, there is no way to reset it.
Set the notification to the raised state . Once notification is saturated it stays saturated forever there is no way to reset it .
pub fn notify(&self, value: T) {
        {
            let mut guard = self.mutex.lock().unwrap();
            if let Some(ref old_value) = *guard {
                if value != *old_value {
                    panic!(
                        "Notified twice with different values: first {:?}, then {:?}",
                        old_value, value
                    );
                } else {
                    return;
                }
            }
            *guard = Some(value);
        }
        self.condvar.notify_all();
    }
pub fn notify ( & self , value : T ) { { let mut guard = self . mutex . lock ( ) . unwrap ( ) ; if let Some ( ref old_value ) = * guard { if value != * old_value { panic ! ( " " old_value value ) ; } else { return ; } } * guard = Some ( value ) ; } self . condvar . notify_all ( ) ; }
Set the notification to the raised state.
Set the notification to the raised state .
&self
value
T
&self
value
T
panics
Panics if `notify` is called twice with different values.
Panics if ` notify ` is called twice with different values .