From: Jonathan Wakely Date: Wed, 13 Nov 2024 16:37:24 +0000 (+0000) Subject: libstdc++: Use __is_single_threaded() in performance tests X-Git-Tag: basepoints/gcc-16~4345 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b92007016ce8de3fc0a8c4508a789b822ea8e6b;p=thirdparty%2Fgcc.git libstdc++: Use __is_single_threaded() in performance tests With recent glibc releases the __gthread_active_p() function is always true, so we always append "-thread" onto performance benchmark names. Use the __gnu_cxx::__is_single_threaded() function instead. libstdc++-v3/ChangeLog: * testsuite/util/testsuite_performance.h: Use __gnu_cxx::__is_single_threaded instead of __gthread_active_p(). --- diff --git a/libstdc++-v3/testsuite/util/testsuite_performance.h b/libstdc++-v3/testsuite/util/testsuite_performance.h index 5d57dbd7d633..4fd95b7e22a7 100644 --- a/libstdc++-v3/testsuite/util/testsuite_performance.h +++ b/libstdc++-v3/testsuite/util/testsuite_performance.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #if defined (__linux__) || defined (__GLIBC__) @@ -223,10 +224,8 @@ namespace __gnu_test std::ofstream out(name, std::ios_base::app); -#ifdef __GTHREADS - if (__gthread_active_p()) + if (!__gnu_cxx::__is_single_threaded()) testname.append("-thread"); -#endif out.setf(std::ios_base::left); out << std::setw(25) << testname << tab; @@ -253,10 +252,8 @@ namespace __gnu_test std::ofstream out(name, std::ios_base::app); -#ifdef __GTHREADS - if (__gthread_active_p ()) + if (!__gnu_cxx::__is_single_threaded ()) testname.append("-thread"); -#endif out.setf(std::ios_base::left); out << std::setw(25) << testname << tab;