From: Matheus Castanho Date: Fri, 9 Jul 2021 14:13:38 +0000 (+0100) Subject: libstdc++: Only use __gthread_yield if gthreads is available X-Git-Tag: basepoints/gcc-13~6093 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e345e4ad6bb6595a9e3b182aa349d4f306b0921;p=thirdparty%2Fgcc.git libstdc++: Only use __gthread_yield if gthreads is available libstdc++-v3/ChangeLog: * include/std/mutex (__lock_impl): Check _GLIBCXX_HAS_GTHREADS before using __gthread_yield. --- diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index eeb51fdb840e..7ab4ee126905 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -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);