Skip to content

Tweaks to compare-and-exchange functions

Latest
Compare
Choose a tag to compare
@glessard glessard released this 21 Apr 20:11
79608d7

Move choice between weak and strong CAS out of the C parameter list in CAtomics

  • In the CAtomics module, all types have direct CompareAndExchangeWeak and CompareAndExchangeStrong functions rather than a single function with a parameter selecting between strong and weak.

  • The old version of CompareAndExchange with a CASType parameter still exists, but forwards to either of the other two, making it objectively worse.

  • SwiftAtomics internally adapts to the above, but is otherwise unchanged.