pub unsafe fn atomic_store<T: AtomicType, Ordering: ReleaseOrRelaxed>(
ptr: *mut T,
v: T,
o: Ordering,
)where
T::Repr: AtomicBasicOps,Expand description
Atomic store over raw pointers.
This function provides a short-cut of Atomic::from_ptr().load(..), and can be used to work
with C side on synchronizations:
atomic_store(.., Relaxed)maps toWRITE_ONCE()when used for inter-thread communication.atomic_load(.., Release)maps tosmp_store_release().
ยงSafety
ptris a valid pointer toTand aligned toalign_of::<T>().- If there is a concurrent access from kernel (C or Rust), it has to be atomic.