pub struct AtomicFallbackPtr<T> { /* private fields */ }
doc
only.Expand description
An example fallback implementation of an atomic pointer.
AtomicPtr
points to a type like this when no built-in atomic pointer is
available.
This type is the pointer version of AtomicFallback
; see its
documentation for more details. Like AtomicFallback
, this type is
exposed only in the documentation for illustrative purposes.
Implementations§
Source§impl<T> AtomicFallbackPtr<T>
impl<T> AtomicFallbackPtr<T>
Sourcepub fn into_inner(self) -> *mut T
pub fn into_inner(self) -> *mut T
Consumes the atomic and returns the contained value.
Sourcepub fn swap(&self, val: *mut T, order: Ordering) -> *mut T
pub fn swap(&self, val: *mut T, order: Ordering) -> *mut T
Stores a value into the atomic, returning the previous value.
Sourcepub fn compare_and_swap(
&self,
current: *mut T,
new: *mut T,
order: Ordering,
) -> *mut T
pub fn compare_and_swap( &self, current: *mut T, new: *mut T, order: Ordering, ) -> *mut T
Stores a value into the atomic if the current value is the same
as the current
value.
Sourcepub fn compare_exchange(
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering,
) -> Result<*mut T, *mut T>
pub fn compare_exchange( &self, current: *mut T, new: *mut T, success: Ordering, failure: Ordering, ) -> Result<*mut T, *mut T>
Stores a value into the atomic if the current value is the same
as the current
value.
Sourcepub fn compare_exchange_weak(
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering,
) -> Result<*mut T, *mut T>
pub fn compare_exchange_weak( &self, current: *mut T, new: *mut T, success: Ordering, failure: Ordering, ) -> Result<*mut T, *mut T>
Stores a value into the atomic if the current value is the same
as the current
value.
Sourcepub fn fetch_update<F>(
&self,
set_order: Ordering,
fetch_order: Ordering,
f: F,
) -> Result<*mut T, *mut T>
pub fn fetch_update<F>( &self, set_order: Ordering, fetch_order: Ordering, f: F, ) -> Result<*mut T, *mut T>
Fetches the value, and applies a function to it that returns an optional new value.