libstdc++: Do not define lock-free atomic aliases if not fully lock-free [PR114103]
The whole point of these typedefs is to guarantee lock-freedom, so if the target has no such types, we shouldn't defined the typedefs at all. libstdc++-v3/ChangeLog: PR libstdc++/114103 * include/bits/version.def (atomic_lock_free_type_aliases): Add extra_cond to check for at least one always-lock-free type. * include/bits/version.h: Regenerate. * include/std/atomic (atomic_signed_lock_free) (atomic_unsigned_lock_free): Only use always-lock-free types. * src/c++20/tzdb.cc (time_zone::_Impl::RulesCounter): Don't use atomic counter if lock-free aliases aren't available. * testsuite/29_atomics/atomic/lock_free_aliases.cc: XFAIL for targets without lock-free word-size compare_exchange.
Showing
- libstdc++-v3/include/bits/version.def 1 addition, 0 deletionslibstdc++-v3/include/bits/version.def
- libstdc++-v3/include/bits/version.h 1 addition, 1 deletionlibstdc++-v3/include/bits/version.h
- libstdc++-v3/include/std/atomic 3 additions, 3 deletionslibstdc++-v3/include/std/atomic
- libstdc++-v3/src/c++20/tzdb.cc 6 additions, 1 deletionlibstdc++-v3/src/c++20/tzdb.cc
- libstdc++-v3/testsuite/29_atomics/atomic/lock_free_aliases.cc 1 addition, 0 deletions...tdc++-v3/testsuite/29_atomics/atomic/lock_free_aliases.cc
Loading
Please register or sign in to comment