Function std::intrinsics::atomic_cxchgweak_seqcst_seqcst
source · pub unsafe extern "rust-intrinsic" fn atomic_cxchgweak_seqcst_seqcst<T>(
dst: *mut T,
old: T,
src: T
) -> (T, bool)where
T: Copy,
🔬This is a nightly-only experimental API. (
core_intrinsics
)Expand description
如果当前值与 old
值相同,则存储一个值。
内部函数的稳定版本可通过 compare_exchange_weak
方法在 atomic
类型上使用,方法是将 Ordering::SeqCst
作为成功和失败参数传递。