[−][src]Struct debra_common::epoch::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
pub fn compare_and_swap(
&self,
current: Epoch,
new: Epoch,
order: Ordering
) -> Epoch
[src]
&self,
current: Epoch,
new: Epoch,
order: Ordering
) -> Epoch
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
impl Sync for AtomicEpoch
impl Unpin for AtomicEpoch
impl Send for AtomicEpoch
impl UnwindSafe for AtomicEpoch
impl RefUnwindSafe for AtomicEpoch
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self