Struct crossbeam_epoch::sync::queue::Queue
source · pub(crate) struct Queue<T> {
head: CachePadded<Atomic<Node<T>>>,
tail: CachePadded<Atomic<Node<T>>>,
}
Fields§
§head: CachePadded<Atomic<Node<T>>>
§tail: CachePadded<Atomic<Node<T>>>
Implementations§
source§impl<T> Queue<T>
impl<T> Queue<T>
sourcefn push_internal(
&self,
onto: Shared<'_, Node<T>>,
new: Shared<'_, Node<T>>,
guard: &Guard,
) -> bool
fn push_internal( &self, onto: Shared<'_, Node<T>>, new: Shared<'_, Node<T>>, guard: &Guard, ) -> bool
Attempts to atomically place n
into the next
pointer of onto
, and returns true
on
success. The queue’s tail
pointer may be updated.
sourcepub(crate) fn push(&self, t: T, guard: &Guard)
pub(crate) fn push(&self, t: T, guard: &Guard)
Adds t
to the back of the queue, possibly waking up threads blocked on pop
.
sourcefn pop_internal(&self, guard: &Guard) -> Result<Option<T>, ()>
fn pop_internal(&self, guard: &Guard) -> Result<Option<T>, ()>
Attempts to pop a data node. Ok(None)
if queue is empty; Err(())
if lost race to pop.
sourcefn pop_if_internal<F>(
&self,
condition: F,
guard: &Guard,
) -> Result<Option<T>, ()>
fn pop_if_internal<F>( &self, condition: F, guard: &Guard, ) -> Result<Option<T>, ()>
Attempts to pop a data node, if the data satisfies the given condition. Ok(None)
if queue
is empty or the data does not satisfy the condition; Err(())
if lost race to pop.
Trait Implementations§
impl<T: Send> Send for Queue<T>
impl<T: Send> Sync for Queue<T>
Auto Trait Implementations§
impl<T> !Freeze for Queue<T>
impl<T> RefUnwindSafe for Queue<T>where
T: RefUnwindSafe,
impl<T> Unpin for Queue<T>
impl<T> UnwindSafe for Queue<T>where
T: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more