Struct pagecache::Stack [−][src]
pub struct Stack<T: Send + 'static> { /* fields omitted */ }
A simple lock-free stack, with the ability to atomically append or entirely swap-out entries.
Methods
impl<T: Send + 'static> Stack<T>
[src]
impl<T: Send + 'static> Stack<T>
pub fn push(&self, inner: T)
[src]
pub fn push(&self, inner: T)
Add an item to the stack, spinning until successful.
pub fn pop(&self) -> Option<T>
[src]
pub fn pop(&self) -> Option<T>
Pop the next item off the stack. Returns None if nothing is there.
pub fn cap<'g>(
&self,
old: Shared<Node<T>>,
new: T,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, Shared<'g, Node<T>>>
[src]
pub fn cap<'g>(
&self,
old: Shared<Node<T>>,
new: T,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, Shared<'g, Node<T>>>
compare and push
pub fn cas<'g>(
&self,
old: Shared<'g, Node<T>>,
new: Shared<'g, Node<T>>,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, Shared<'g, Node<T>>>
[src]
pub fn cas<'g>(
&self,
old: Shared<'g, Node<T>>,
new: Shared<'g, Node<T>>,
guard: &'g Guard
) -> Result<Shared<'g, Node<T>>, Shared<'g, Node<T>>>
attempt consolidation
pub fn head<'g>(&self, guard: &'g Guard) -> Shared<'g, Node<T>>
[src]
pub fn head<'g>(&self, guard: &'g Guard) -> Shared<'g, Node<T>>
Returns the current head pointer of the stack, which can later be used as the key for cas and cap operations.
Trait Implementations
impl<T: Send + 'static> Default for Stack<T>
[src]
impl<T: Send + 'static> Default for Stack<T>
impl<T: Send + 'static> Drop for Stack<T>
[src]
impl<T: Send + 'static> Drop for Stack<T>
impl<T> Debug for Stack<T> where
T: Debug + Send + 'static + Sync,
[src]
impl<T> Debug for Stack<T> where
T: Debug + Send + 'static + Sync,