diff --git a/libstdc++-v3/testsuite/util/testsuite_performance.h b/libstdc++-v3/testsuite/util/testsuite_performance.h
index 5d57dbd7d633ce6ebc49694248900d729fba0d05..4fd95b7e22a7d777a0ab78d9b7729bedaeebd7bf 100644
--- a/libstdc++-v3/testsuite/util/testsuite_performance.h
+++ b/libstdc++-v3/testsuite/util/testsuite_performance.h
@@ -33,6 +33,7 @@
 #include <stdexcept>
 #include <sstream>
 #include <cxxabi.h>
+#include <ext/atomicity.h>
 #include <testsuite_common_types.h>
 
 #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;