1.基本型(不带返回值)
atomic_{add,sub,inc,dec}();
atomic_{and,or,xor,andnot}();
atomic_{xchg,cmpxchg,try_cmpxchg}();
atomic64_
atomic_long_
2.返回值
2.1(返回修改之后的值) _return 后缀
atomic_add_return
2.2(返回修改之前的值) _fetch 前缀
atomic_fetch_and
_acquire,_release, _relaxed后缀
这个后缀是要放到最后的
符号
ATOMIC64_INIT
arch_atomic64_fetch_add_relaxed
arch_atomic64_fetch_and_relaxed
arch_atomic64_fetch_or_relaxed
arch_atomic64_fetch_sub_relaxed
arch_atomic64_fetch_xor_relaxed
arch_atomic_fetch_add_relaxed
arch_atomic_fetch_and_relaxed
arch_atomic_fetch_or_relaxed
arch_atomic_fetch_sub_relaxed
arch_atomic_fetch_xor_relaxed
ATOMIC_FETCH_OP
arch_atomic64_read
arch_atomic64_set
arch_atomic_read
arch_atomic_set
arch_atomic_xchg
arm32 arch_atomic_xchg 封装了 arch_xchg
arch_atomic_cmpxchg
arch_atomic_cmpxchg_relaxed
arm32 arch_atomic_xchg 和 arch_cmpxchg_relaxed 实现相同
ATOMIC_OP
arch_atomic64_add_return_relaxed
arch_atomic64_sub_return_relaxed
arch_atomic_add_return_relaxed
arch_atomic_sub_return_relaxed
ATOMIC_OP_RETURN
arch_atomic64_dec_if_positive
- [atomic.h atomic_xchg系列 和 cmpxchg.h arch_xchg系列 的关系]
arm32 比较乱
arm64 atomic_xchg 底层 为 arch_xchg
riscv atomic_xchg 底层 为 arch_xchg
arch_xchg
arch_xchg_relaxed
arch_cmpxchg_local
arch_cmpxchg_relaxed
arch_cmpxchg64_local
arch_futex_atomic_op_inuser
futex_atomic_cmpxchg_inatomic