pub fn release_bit(&self, index: usize) -> bool {
        let byte = {
            assert!(
                index < self.bits,
                "Index out of range: {} >= {}",
                index,
                self.bits
            );

            &self.slice[index / 8]
        };

        let bit = index % 8;

        // Use the fetch_update result - if a modification was made, we
        // freed the bit.
        byte.fetch_update(Relaxed, Relaxed, |val| {
            if val & (1 << bit) != 0 {
                // Clear the bit
                Some(val & !(1 << bit))
            } else {
                None
            }
        })
        .is_ok()
    }
/// Atomically sets the bit at the given index to free. Returns true if
/// the bit was used, false if the bit was already free.
Atomically sets the bit at the given index to free. Returns true if
the bit was used, false if the bit was already free.
Atomically sets the bit at the given index to free . Returns true if the bit was used false if the bit was already free .
pub fn release_bit(&self, index: usize) -> bool {
        let byte = {
            assert!(
                index < self.bits,
                "Index out of range: {} >= {}",
                index,
                self.bits
            );
            &self.slice[index / 8]
        };
        let bit = index % 8;
        // Use the fetch_update result - if a modification was made, we
        // freed the bit.
        byte.fetch_update(Relaxed, Relaxed, |val| {
            if val & (1 << bit) != 0 {
                // Clear the bit
                Some(val & !(1 << bit))
            } else {
                None
            }
        })
        .is_ok()
    }
pub fn release_bit ( & self , index : usize ) -> bool { let byte = { assert ! ( index self bits " " index self bits ) ; & self . slice [ index / 8 ] } ; let bit = index % 8 ; // Use the fetch_update result - if a modification was made, we // freed the bit. byte . fetch_update ( Relaxed , Relaxed , | val | { if val & ( 1 << bit ) != 0 { // Clear the bit Some ( val & ! ( 1 << bit ) ) } else { None } } ) . is_ok ( ) }
Atomically sets the bit at the given index to free.
Atomically sets the bit at the given index to free .
&self
index
usize