]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Only use __gthread_yield if gthreads is available
authorMatheus Castanho <msc@linux.ibm.com>
Fri, 9 Jul 2021 14:13:38 +0000 (15:13 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 9 Jul 2021 14:13:38 +0000 (15:13 +0100)
libstdc++-v3/ChangeLog:

* include/std/mutex (__lock_impl): Check
_GLIBCXX_HAS_GTHREADS before using __gthread_yield.

libstdc++-v3/include/std/mutex

index eeb51fdb840e4f0fc8d76094f03eac188adf4b6a..7ab4ee126905e1424e18edfcff8e09ac41bfe63b 100644 (file)
@@ -618,7 +618,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                      return;
                    }
                }
-#ifdef _GLIBCXX_USE_SCHED_YIELD
+#if defined _GLIBCXX_HAS_GTHREADS && defined _GLIBCXX_USE_SCHED_YIELD
                __gthread_yield();
 #endif
                constexpr auto __n = 1 + sizeof...(_L1);