pub fn pop(&mut self) -> Option<T> {
        let mut guard = self.ebr.pin();

        let mut cur_head_ptr = self.head.load(Acquire);

        loop {
            if cur_head_ptr.is_null() {
                return None;
            }

            let next = unsafe { (*cur_head_ptr).next.load(Acquire) };
            let result = self
                .head
                .compare_exchange(cur_head_ptr, next, Release, Release);

            if let Err(current) = result {
                cur_head_ptr = current;
            } else {
                unsafe {
                    let node: Box<Node<T>> = Box::from_raw(cur_head_ptr);
                    let item = node.item.as_ptr().read();
                    guard.defer_drop(node);
                    return Some(item);
                }
            }
        }
    }
/// Pop an item off of the stack. Note that this
/// requires a mutable self reference, because it
/// involves the use of epoch based reclamation to
/// properly GC deallocated memory once complete.
Pop an item off of the stack. Note that this
requires a mutable self reference, because it
involves the use of epoch based reclamation to
properly GC deallocated memory once complete.
Pop an item off of the stack . Note that this requires a mutable self reference because it involves the use of epoch based reclamation to properly GC deallocated memory once complete .
pub fn pop(&mut self) -> Option<T> {
        let mut guard = self.ebr.pin();
        let mut cur_head_ptr = self.head.load(Acquire);
        loop {
            if cur_head_ptr.is_null() {
                return None;
            }
            let next = unsafe { (*cur_head_ptr).next.load(Acquire) };
            let result = self
                .head
                .compare_exchange(cur_head_ptr, next, Release, Release);
            if let Err(current) = result {
                cur_head_ptr = current;
            } else {
                unsafe {
                    let node: Box<Node<T>> = Box::from_raw(cur_head_ptr);
                    let item = node.item.as_ptr().read();
                    guard.defer_drop(node);
                    return Some(item);
                }
            }
        }
    }
pub fn pop ( & mut self ) -> Option < T > { let mut guard = self . ebr . pin ( ) ; let mut cur_head_ptr = self . head . load ( Acquire ) ; loop { if cur_head_ptr . is_null ( ) { return None ; } let next = unsafe { ( * cur_head_ptr ) . next . load ( Acquire ) } ; let result = self . head . compare_exchange ( cur_head_ptr , next , Release , Release ) ; if let Err ( current ) = result { cur_head_ptr = current ; } else { unsafe { let node : Box < Node < T > > = Box :: from_raw ( cur_head_ptr ) ; let item = node . item . as_ptr ( ) . read ( ) ; guard . defer_drop ( node ) ; return Some ( item ) ; } } } }
Pop an item off of the stack.
Pop an item off of the stack .
&mut self
&mut self