P99
|
◆ atomic_fetch_max_explicit
Value:
({ \
P99_MACRO_VAR(p00_objp, (OBJP)); \
P99_MACRO_VAR(p00_op, (OPERAND)); \
__typeof__(atomic_load(p00_objp)) p00_ret; \
/* be sure that the result can not be used as an lvalue */ \
register __typeof__(p00_ret = p00_ret) p00_r = atomic_load(p00_objp); \
p00_ret = p00_r; \
while (p00_r <= p00_op) { \
if (atomic_compare_exchange_weak(p00_objp, &p00_ret, p00_op)) break; \
else p00_r = p00_ret; \
} \
p00_r = p00_ret; \
})
Atomically do a max operation between OPERAND and *OBJP.
OPERAND must be assignment compatible with the base type of OBJP. ORD is the value for the memory consistency. Currently this argument will not be taken into account for types that aren't natively supported with atomic operations.
Definition at line 1381 of file p99_atomic.h. |