[gcc r16-5319] libstdc++: Include <mutex> in syncbuf.cc [PR122698]
Jonathan Wakely
redi@gcc.gnu.org
Sun Nov 16 14:03:05 GMT 2025
https://gcc.gnu.org/g:84dbb22f32a525a0f0e0b7c02c56eec2fa6f39da
commit r16-5319-g84dbb22f32a525a0f0e0b7c02c56eec2fa6f39da
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Sun Nov 16 13:57:25 2025 +0000
libstdc++: Include <mutex> in syncbuf.cc [PR122698]
For most configurations bits/std_mutex.h would already be included by
<syncstream>, but not if configured with _GLIBCXX_USE_CXX11_ABI=0 as the
default, because syncbuf is disabled in that case.
libstdc++-v3/ChangeLog:
PR libstdc++/122698
* src/c++20/syncbuf.cc (__syncbuf_get_mutex): Include <mutex>.
Fix indentation of function body.
Diff:
---
libstdc++-v3/src/c++20/syncbuf.cc | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/libstdc++-v3/src/c++20/syncbuf.cc b/libstdc++-v3/src/c++20/syncbuf.cc
index 150ba5e3ce4d..1fe380ec2830 100644
--- a/libstdc++-v3/src/c++20/syncbuf.cc
+++ b/libstdc++-v3/src/c++20/syncbuf.cc
@@ -23,6 +23,7 @@
// <http://www.gnu.org/licenses/>.
#include <syncstream>
+#include <mutex>
#include <bits/functional_hash.h>
#if _GLIBCXX_HAS_GTHREADS
@@ -32,13 +33,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
mutex&
__syncbuf_get_mutex(void* __t)
- {
- const unsigned char __mask = 0xf;
- static mutex __m[__mask + 1];
+{
+ const unsigned char __mask = 0xf;
+ static mutex __m[__mask + 1];
- auto __key = _Hash_impl::hash(__t) & __mask;
- return __m[__key];
- }
+ auto __key = _Hash_impl::hash(__t) & __mask;
+ return __m[__key];
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
More information about the Gcc-cvs
mailing list