pub unsafe fn atomic_load<T: AtomicType, Ordering: AcquireOrRelaxed>(
ptr: *mut T,
o: Ordering,
) -> Twhere
T::Repr: AtomicBasicOps,Expand description
Atomic load 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_load(.., Relaxed)maps toREAD_ONCE()when used for inter-thread communication.atomic_load(.., Acquire)maps tosmp_load_acquire().
ยงSafety
ptris a valid pointer toTand aligned toalign_of::<T>().- If there is a concurrent store from kernel (C or Rust), it has to be atomic.