]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Disable atomic wait for freestanding [PR105021]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 22 Mar 2022 21:17:01 +0000 (21:17 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 23 Mar 2022 10:03:03 +0000 (10:03 +0000)
We use either condition variables or futexes to implement atomic waits,
so we can't do it in freestanding. This is non-conforming, so should be
revisited later, probably by making freestanding atomic waiting
operations spin without ever blocking.

Reviewed-by: Thomas Rodgers <trodgers@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/105021
* include/bits/atomic_base.h [!_GLIBCXX_HOSTED]: Do not include
<bits/atomic_wait.h> for freestanding.

libstdc++-v3/include/bits/atomic_base.h

index d86766cf39b9db2c492a53ed91ee101c2a62d32e..2cad8486c6942364aae3280f4e24ec330e82c332 100644 (file)
@@ -37,7 +37,7 @@
 #include <bits/atomic_lockfree_defines.h>
 #include <bits/move.h>
 
-#if __cplusplus > 201703L
+#if __cplusplus > 201703L && _GLIBCXX_HOSTED
 #include <bits/atomic_wait.h>
 #endif