unsafe fn dequeue(&self) -> Dequeue<T, W> {
        let mut tail = *self.tail_readiness.get();
        let mut next = (*tail).next_readiness.load(Acquire);

        if tail == self.stub() {
            if next.is_null() {
                return Dequeue::Empty;
            }

            *self.tail_readiness.get() = next;
            tail = next;
            next = (*next).next_readiness.load(Acquire);
        }

        if !next.is_null() {
            *self.tail_readiness.get() = next;
            debug_assert!(tail != self.stub());
            return Dequeue::Data(tail);
        }

        if self.head_readiness.load(Acquire) as *const _ != tail {
            return Dequeue::Inconsistent;
        }

        self.enqueue(self.stub());

        next = (*tail).next_readiness.load(Acquire);

        if !next.is_null() {
            *self.tail_readiness.get() = next;
            return Dequeue::Data(tail);
        }

        Dequeue::Inconsistent
    }
/// The dequeue function from the 1024cores intrusive MPSC queue algorithm
///
/// Note that this unsafe as it required mutual exclusion (only one thread
/// can call this) to be guaranteed elsewhere.
The dequeue function from the 1024cores intrusive MPSC queue algorithm
Note that this unsafe as it required mutual exclusion (only one thread
can call this) to be guaranteed elsewhere.
The dequeue function from the 1024cores intrusive MPSC queue algorithm Note that this unsafe as it required mutual exclusion ( only one thread can call this ) to be guaranteed elsewhere .
unsafe fn dequeue(&self) -> Dequeue<T, W> {
        let mut tail = *self.tail_readiness.get();
        let mut next = (*tail).next_readiness.load(Acquire);
        if tail == self.stub() {
            if next.is_null() {
                return Dequeue::Empty;
            }
            *self.tail_readiness.get() = next;
            tail = next;
            next = (*next).next_readiness.load(Acquire);
        }
        if !next.is_null() {
            *self.tail_readiness.get() = next;
            debug_assert!(tail != self.stub());
            return Dequeue::Data(tail);
        }
        if self.head_readiness.load(Acquire) as *const _ != tail {
            return Dequeue::Inconsistent;
        }
        self.enqueue(self.stub());
        next = (*tail).next_readiness.load(Acquire);
        if !next.is_null() {
            *self.tail_readiness.get() = next;
            return Dequeue::Data(tail);
        }
        Dequeue::Inconsistent
    }
unsafe fn dequeue ( & self ) -> Dequeue < T , W > { let mut tail = * self . tail_readiness . get ( ) ; let mut next = ( * tail ) . next_readiness . load ( Acquire ) ; if tail == self . stub ( ) { if next . is_null ( ) { return Dequeue :: Empty ; } * self . tail_readiness . get ( ) = next ; tail = next ; next = ( * next ) . next_readiness . load ( Acquire ) ; } if ! next . is_null ( ) { * self . tail_readiness . get ( ) = next ; debug_assert ! ( tail self stub ( ) ) ; return Dequeue :: Data ( tail ) ; } if self . head_readiness . load ( Acquire ) as * const _ != tail { return Dequeue :: Inconsistent ; } self . enqueue ( self . stub ( ) ) ; next = ( * tail ) . next_readiness . load ( Acquire ) ; if ! next . is_null ( ) { * self . tail_readiness . get ( ) = next ; return Dequeue :: Data ( tail ) ; } Dequeue :: Inconsistent }
The dequeue function from the 1024cores intrusive MPSC queue algorithm
Note that this unsafe as it required mutual exclusion (only one thread
can call this) to be guaranteed elsewhere.
The dequeue function from the 1024cores intrusive MPSC queue algorithm Note that this unsafe as it required mutual exclusion ( only one thread can call this ) to be guaranteed elsewhere .
&self
&self