[Bug libstdc++/103638] [11 Regression] #include <atomic> gives errors for --disable-threads builds

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 12 20:18:09 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103638

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:105f1c08369aa6702d070f911dd658b93230ac46

commit r11-9833-g105f1c08369aa6702d070f911dd658b93230ac46
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Dec 10 11:44:29 2021 +0000

    libstdc++: Guard mutex and condvar with gthreads macro [PR103638]

    A mutex and condition variable is used for timed waits on atomics if
    there is no "platform wait" (e.g. futex) supported. But the use of those
    types wasn't guarded by the _GLIBCXX_HAS_GTHREADS macro, causing errors
    for --disable-threads builds. This fix allows <atomic> to work on
    targets with futexes but no gthreads.

    libstdc++-v3/ChangeLog:

            PR libstdc++/103638
            * include/bits/atomic_timed_wait.h: Check _GLIBCXX_HAS_GTHREADS
            before using std::mutex and std::__condvar.

    (cherry picked from commit ffb632517fc446474baba10ee2ff13a218ec2c7b)


More information about the Gcc-bugs mailing list