pub unsafe fn aws_atomic_compare_exchange_ptr(
var: *mut AwsCAtomicVar,
expected: *mut *mut c_void,
desired: *mut c_void
) -> 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.