pub trait AtomicExt<T> {
// Required methods
fn compare_exchange_explicit(
&self,
current: T,
new: T,
success_order: Ordering,
failure_order: Ordering,
) -> Result<T, T>;
fn fetch_add_explicit(&self, val: T, order: Ordering) -> T;
fn fetch_sub_explicit(&self, val: T, order: Ordering) -> T;
fn load_with_barrier(&self, barrier: BarrierType) -> T;
fn store_with_barrier(&self, val: T, barrier: BarrierType);
}
Expand description
Cross-platform atomic operation extensions.
Required Methods§
Sourcefn compare_exchange_explicit(
&self,
current: T,
new: T,
success_order: Ordering,
failure_order: Ordering,
) -> Result<T, T>
fn compare_exchange_explicit( &self, current: T, new: T, success_order: Ordering, failure_order: Ordering, ) -> Result<T, T>
Atomic compare-and-swap with explicit memory ordering.
Sourcefn fetch_add_explicit(&self, val: T, order: Ordering) -> T
fn fetch_add_explicit(&self, val: T, order: Ordering) -> T
Atomic fetch-and-add with explicit memory ordering.
Sourcefn fetch_sub_explicit(&self, val: T, order: Ordering) -> T
fn fetch_sub_explicit(&self, val: T, order: Ordering) -> T
Atomic fetch-and-subtract with explicit memory ordering.
Sourcefn load_with_barrier(&self, barrier: BarrierType) -> T
fn load_with_barrier(&self, barrier: BarrierType) -> T
Atomic load with memory barrier.
Sourcefn store_with_barrier(&self, val: T, barrier: BarrierType)
fn store_with_barrier(&self, val: T, barrier: BarrierType)
Atomic store with memory barrier.