public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2220] libstdc++: Only use __gthread_yield if gthreads is available
@ 2021-07-09 14:19 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-07-09 14:19 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:2e345e4ad6bb6595a9e3b182aa349d4f306b0921
commit r12-2220-g2e345e4ad6bb6595a9e3b182aa349d4f306b0921
Author: Matheus Castanho <msc@linux.ibm.com>
Date: Fri Jul 9 15:13:38 2021 +0100
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:
---
libstdc++-v3/include/std/mutex | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index eeb51fdb840..7ab4ee12690 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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-07-09 14:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 14:19 [gcc r12-2220] libstdc++: Only use __gthread_yield if gthreads is available Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).