1. 函数原型: bool __atomic_compare_exchange_n(type *ptr,type*expected,typedesired, bool weak, int success_memorder, int failure_memorder) 函数说明: his built-in function implements an atomic compare and exchange operation. This compares the contents of*ptrwith the contents of*expected. If e...
C atomic_exchange( volatile A* obj, C desired ); (1) (C11 起) C atomic_exchange_explicit( volatile A* obj, C desired, memory_order order ); (2) (C11 起) 原子地以 desired 替换obj 所指向的对象的值,并返回 obj 先前所保有的值。此操作是读修改写操作。第一版本按照 memory_order_seq...
_Bool atomic_compare_exchange_weak_explicit(volatileA*obj, C*expected, C desired, memory_ordersucc, memory_orderfail); (4)(C11 起) 原子地比较obj所指向对象的内存的内容与expected所指向的内存的内容。若它们相等,则以desired替换前者(进行读修改写操作)。否则,将obj所指向的实际内存内容加载到*expected(...