impatomic: add strong/weak compare_exchange
authorBrian Norris <banorris@uci.edu>
Wed, 10 Oct 2012 22:16:59 +0000 (15:16 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 10 Oct 2012 22:16:59 +0000 (15:16 -0700)
commit20a4630cb01dc613d138d29a4b03a424bf1fd74d
tree0894f19f7dda8ed92bc48479b69028ff13f0a6e6
parent1645d16c883f765168a26892f07d003963d5b68c
impatomic: add strong/weak compare_exchange

According to n2748.html, there was a change to allow spurious failure of
compare_exchange operations. Thus, there is no longer a
compare_exchange() operation, but rather a pair of
compare_exchange_{strong,weak)(). I resolve this for compilation
purposes now by editing the impatomic header (mostly with Vim macros for
patterned copy-paste-substitute) and adding an _ATOMIC_CMPSWP_WEAK_
macro, which is just an alias for _ATOMIC_CMPSWP_. Thus, we don't
simulate spurious failure yet.

See:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2748.html
include/impatomic.h