]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Guard mutex and condvar with gthreads macro [PR103638]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 10 Dec 2021 11:44:29 +0000 (11:44 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 12 Apr 2022 20:17:49 +0000 (21:17 +0100)
commit105f1c08369aa6702d070f911dd658b93230ac46
tree61b94305b00970cad7169b00d0e02e57659ca201
parent3f3755932c9c6ede94ac2131d4db70717b346164
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)
libstdc++-v3/include/bits/atomic_timed_wait.h