pub unsafe fn atomic_compare_exchange<I: Integer, const SCOPE: u32, const EQUAL: u32, const UNEQUAL: u32>(
ptr: &mut I,
value: I,
comparator: I,
) -> IExpand description
Perform the following steps atomically with respect to any other atomic
accesses within SCOPE to the same location:
- Load through
ptrto get the original value - Get a new value from
valueonly if the original value equalscomparator, and - Store the new value back through
ptr, only if the original value equaledcomparator.
The result is the original value.