[][src]Struct debra_common::epoch::AtomicEpoch

pub struct AtomicEpoch(_);

An atomic and concurrently accessible Epoch.

Methods

impl AtomicEpoch[src]

pub const fn new() -> Self[src]

Creates a new AtomicEpoch starting at zero.

pub fn load(&self, order: Ordering) -> Epoch[src]

Loads the Epoch value.

load takes an Ordering argument, which describes the memory ordering of this operation.

Panics

Panics if order is Release or AcqRel.

pub fn compare_and_swap(
    &self,
    current: Epoch,
    new: Epoch,
    order: Ordering
) -> Epoch
[src]

Stores a value into the Epoch if the current value is equal to current.

The return value is always the previous value. If it is equal to current, then the value was updated.

compare_and_swap also takes an Ordering argument, which describes the memory ordering of this operation. Notice that even when using AcqRel, the operation might fail and hence just perform an Acquire load, but not have Release semantics. Using Acquire makes the store part of this operation Relaxed, if it happens, and using Release makes the load part Relaxed.

Trait Implementations

impl Debug for AtomicEpoch[src]

impl Display for AtomicEpoch[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self