pub unsafe fn aws_atomic_compare_exchange_int(
var: *mut AwsCAtomicVar,
expected: *mut usize,
desired: usize
) -> bool
Expand description
Atomically compares *var
to *expected
; if they are equal, atomically sets *var = desired
. Otherwise, *expected
is set
to the value in *var
. Uses sequentially consistent memory ordering, regardless of success or failure.
Returns true
if the compare was successful and the variable updated to desired.
Safety
The caller must ensure that the AwsCAtomicVar
pointer is valid.