pub unsafe fn xchg<T: AtomicType, Ordering: Ordering>(
ptr: *mut T,
new: T,
o: Ordering,
) -> Twhere
T::Repr: AtomicExchangeOps,Expand description
Atomic exchange over raw pointers.
This function provides a short-cut of Atomic::from_ptr().xchg(..), and can be used to work
with C side on synchronizations.
ยง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.