[Bug c++/54729] __compare_and_swap does not return on all paths

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 27 17:34:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54729

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-09-27 17:34:01 UTC ---
(In reply to comment #0)
> I had wrongly used the __compare_and_swap with a "volatile bool" variable and
> without the _GLIBCXX_DEBUG and _GLIBCXX_PARALLEL being defined.

So don't do that.

If you want a CAS function use the __atomic_compare_exchange builtin, not the
parallel mode's internal implementation details.



More information about the Gcc-bugs mailing list