Atomically compares the atomic value with that of expected. If those are bitwise-equal, replaces the former with desired (performs read-modify-write operation). Otherwise, loads the actual atomic value stored into expected (performs load operation).
The expected value
The new desired value
true if the underlying atomic value was successfully changed, false otherwise.
See Implementation
Atomically compares the atomic value with that of expected. If those are bitwise-equal, replaces the former with desired (performs read-modify-write operation). Otherwise, loads the actual atomic value stored into expected (performs load operation).