]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/50196 ([C++0x] std::thread not available under macos)
authorJonathan Wakely <jwakely.gcc@gmail.com>
Sat, 22 Oct 2011 21:31:24 +0000 (21:31 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Sat, 22 Oct 2011 21:31:24 +0000 (22:31 +0100)
PR libstdc++/50196
* acinclude.m4 (GLIBCXX_HAS_GTHREADS): Don't depend on _POSIX_TIMEOUTS.
* configure: Regenerate.
* include/std/mutex (timed_mutex, recursive_timed_mutex): Define
conditionally on GTHREADS_HAS_MUTEX_TIMEDLOCK.
* testsuite/lib/libstdc++.exp (check_v3_target_gthreads_timed): Define.
* testsuite/lib/dg-options.exp (dg-require-gthreads-timed): Define.
* testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc:
Use dg-require-gthreads-timed instead of dg-require-gthreads.
* testsuite/30_threads/recursive_timed_mutex/native_handle/
typesizes.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc:
Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc:
Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc:
Likewise.
* testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc:
Likewise.
* testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc:
Likewise.
* testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc:
Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc:
Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc:
Likewise.
* testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc:
Likewise.
* testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise.
* testsuite/30_threads/timed_mutex/native_handle/typesizes.cc:
Likewise.
* testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise.
* testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise.
* testsuite/30_threads/timed_mutex/cons/1.cc: Likewise.
* testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise.
* testsuite/30_threads/timed_mutex/requirements/standard_layout.cc:
Likewise.
* testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise.
* testsuite/30_threads/timed_mutex/lock/1.cc: Likewise.
* testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise.
* testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise.
* testsuite/30_threads/unique_lock/cons/5.cc: Likewise.
* testsuite/30_threads/unique_lock/cons/6.cc: Likewise.
* testsuite/30_threads/unique_lock/locking/3.cc: Likewise.
* testsuite/30_threads/unique_lock/locking/4.cc: Likewise.

From-SVN: r180329

44 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/acinclude.m4
libstdc++-v3/configure
libstdc++-v3/include/std/mutex
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc
libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/cons/assign_neg.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/cons/copy_neg.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/requirements/standard_layout.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/requirements/typedefs.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc
libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc
libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc
libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc
libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc
libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc
libstdc++-v3/testsuite/lib/dg-options.exp
libstdc++-v3/testsuite/lib/libstdc++.exp

index 9f70e377e77bfe080f3b76771441713790a930ff..40e89df11e0116fd31b2e587e28c1c08c765b391 100644 (file)
@@ -1,3 +1,64 @@
+2011-10-22  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       PR libstdc++/50196
+       * acinclude.m4 (GLIBCXX_HAS_GTHREADS): Don't depend on _POSIX_TIMEOUTS.
+       * configure: Regenerate.
+       * include/std/mutex (timed_mutex, recursive_timed_mutex): Define
+       conditionally on GTHREADS_HAS_MUTEX_TIMEDLOCK.
+       * testsuite/lib/libstdc++.exp (check_v3_target_gthreads_timed): Define.
+       * testsuite/lib/dg-options.exp (dg-require-gthreads-timed): Define.
+       * testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc:
+       Use dg-require-gthreads-timed instead of dg-require-gthreads.
+       * testsuite/30_threads/recursive_timed_mutex/native_handle/
+       typesizes.cc: Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc:
+       Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc:
+       Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc:
+       Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc:
+       Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/cons/1.cc: Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc:
+       Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc:
+       Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc: Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc: Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/lock/1.cc: Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/lock/2.cc: Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/unlock/1.cc: Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc:
+       Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc:
+       Likewise.
+       * testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc:
+       Likewise.
+       * testsuite/30_threads/timed_mutex/dest/destructor_locked.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/native_handle/typesizes.cc:
+       Likewise.
+       * testsuite/30_threads/timed_mutex/native_handle/1.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/try_lock_until/1.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/try_lock_until/2.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/cons/assign_neg.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/cons/1.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/cons/copy_neg.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/requirements/standard_layout.cc:
+       Likewise.
+       * testsuite/30_threads/timed_mutex/requirements/typedefs.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/lock/1.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/try_lock_for/1.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/try_lock_for/2.cc: Likewise.
+       * testsuite/30_threads/timed_mutex/try_lock_for/3.cc: Likewise.
+       * testsuite/30_threads/unique_lock/cons/5.cc: Likewise.
+       * testsuite/30_threads/unique_lock/cons/6.cc: Likewise.
+       * testsuite/30_threads/unique_lock/locking/3.cc: Likewise.
+       * testsuite/30_threads/unique_lock/locking/4.cc: Likewise.
+
 2011-10-19  Ed Smith-Rowland  <3dw4rd@verizon.net>
 
        * include/tr2/bool_set (bool_set): New.
index 7196acfc3741de38610148184350d2155800a632..0ee61bf99780f2e7d403a4d13278f9cf6aaee58a 100644 (file)
@@ -3358,11 +3358,19 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS="$CXXFLAGS -fno-exceptions -I${toplevel_srcdir}/gcc"
 
-  AC_MSG_CHECKING([check whether it can be safely assumed that mutex_timedlock is available])
+  target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
+  case $target_thread_file in
+    posix)
+      CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS"
+  esac
+
+  AC_MSG_CHECKING([whether it can be safely assumed that mutex_timedlock is available])
 
   AC_TRY_COMPILE([#include <unistd.h>],
     [
-      #if !defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS < 0
+      // In case of POSIX threads check _POSIX_TIMEOUTS.
+      #if (defined(_PTHREADS) \
+          && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
       #error
       #endif
     ], [ac_gthread_use_mutex_timedlock=1], [ac_gthread_use_mutex_timedlock=0])
@@ -3374,28 +3382,13 @@ AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
   else res_mutex_timedlock=no ; fi
   AC_MSG_RESULT([$res_mutex_timedlock])
 
-  target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
-  case $target_thread_file in
-    posix)
-      CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS"
-  esac
-
   AC_MSG_CHECKING([for gthreads library])
 
-  AC_TRY_COMPILE([
-                  #include "gthr.h"
-                 #include <unistd.h>
-                 ],
+  AC_TRY_COMPILE([#include "gthr.h"],
     [
       #ifndef __GTHREADS_CXX0X
       #error
       #endif
-
-      // In case of POSIX threads check _POSIX_TIMEOUTS too.
-      #if (defined(_PTHREADS) \
-          && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
-      #error
-      #endif
     ], [ac_has_gthreads=yes], [ac_has_gthreads=no])
 
   AC_MSG_RESULT([$ac_has_gthreads])
index 87579d9c7c7dff325b534295f2c59f170acc97f7..5e9078d4a93a18db3f1bbc24b40b00421d2fe208 100755 (executable)
@@ -19823,8 +19823,14 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS="$CXXFLAGS -fno-exceptions -I${toplevel_srcdir}/gcc"
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking check whether it can be safely assumed that mutex_timedlock is available" >&5
-$as_echo_n "checking check whether it can be safely assumed that mutex_timedlock is available... " >&6; }
+  target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
+  case $target_thread_file in
+    posix)
+      CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS"
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it can be safely assumed that mutex_timedlock is available" >&5
+$as_echo_n "checking whether it can be safely assumed that mutex_timedlock is available... " >&6; }
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -19833,7 +19839,9 @@ int
 main ()
 {
 
-      #if !defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS < 0
+      // In case of POSIX threads check _POSIX_TIMEOUTS.
+      #if (defined(_PTHREADS) \
+          && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
       #error
       #endif
 
@@ -19859,21 +19867,12 @@ _ACEOF
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $res_mutex_timedlock" >&5
 $as_echo "$res_mutex_timedlock" >&6; }
 
-  target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
-  case $target_thread_file in
-    posix)
-      CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS"
-  esac
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gthreads library" >&5
 $as_echo_n "checking for gthreads library... " >&6; }
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-                  #include "gthr.h"
-                 #include <unistd.h>
-
+#include "gthr.h"
 int
 main ()
 {
@@ -19882,12 +19881,6 @@ main ()
       #error
       #endif
 
-      // In case of POSIX threads check _POSIX_TIMEOUTS too.
-      #if (defined(_PTHREADS) \
-          && (!defined(_POSIX_TIMEOUTS) || _POSIX_TIMEOUTS <= 0))
-      #error
-      #endif
-
   ;
   return 0;
 }
index 184011715c75f9b61ecf0b07793cd7c163e5b8bc..a1a63b27f334587f7de09d85aac4c240df0b9f61 100644 (file)
@@ -206,6 +206,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { return &_M_mutex; }
   };
 
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
   /// timed_mutex
   class timed_mutex
   {
@@ -417,6 +418,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        return try_lock_until(__atime);
       }
   };
+#endif
 
   /// Do not acquire ownership of the mutex.
   struct defer_lock_t { };
index cc257956ce07dd97cc89d3835001bf435a141972..ace63b3e209dd7c4ba3f053be821ab76d87ed33e 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 1694423cb1f8da876f126232a3f0e697b93e7fa1..291a469d6b8d6044feb8c8e3249edaf3f7370002 100644 (file)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index c729d5b76a25125369892cbf7dcca782d32f179f..6c7d31cae4c7baf01667a0a6c29393469488ae4b 100644 (file)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 8442fbfa52898d38ba5909ff255dca3c6eee661e..26f95b3ea4b7dc693a6e819e26c234c1512f2ae8 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 2fc97e019ff7e2c054d983a0cac47310bcb91558..d57f97cff49ee4400c0cf479fffdad896c2a7348 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index c725b63b634fafcb0a2b52b49dfe155154a9c93f..29fc4c37edf7d62037c79e840e7aad9287dcbb10 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 96e64f34c712ac2ee827d410de2d90f027551e17..89554e0bb65bebc728cfaa281e9f7696c08dd322 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index d2fd9f6e0e5dab07aa3030de26366825a0233c22..76fd2a73e370badfc851e5ad77ef98fd3e2a46f6 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 46a27d6da3eb7437dfa6193b447d8d5b0b9d92bf..cb70ab3f0687a8fc9fe0a2e5d2889cbf4410c093 100644 (file)
@@ -1,11 +1,11 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
 // 2008-03-18 Benjamin Kosnik <bkoz@redhat.com>
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index d61f821c6914e0bea80184d97e942343f0a1a272..c7b8720cab624b14c2aa3c41e95484d7baba5f36 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 0e95bab943d548a6aadeb1f09065420725cf0c6b..f479d9db2411fbcb346db8cfd3078fe93477c32f 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options "-std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options "-std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index d4e7d0a2f91dfacd260a222bfb2171ee503c8d6b..7a87cafd7ae6a92cf08b44d01272a95a625f2824 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 207cad6ace7ad0eef6c370dfae6dacfc50d2d220..950e9f2f3f1bfc2c7641ba77e28ee06127f4d05c 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index d4a93484b26585663f60ad75012590b9fd70d20b..f05000ad39ad91661a75bd6a5d6cf0f1b9e333ad 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index d61f821c6914e0bea80184d97e942343f0a1a272..c7b8720cab624b14c2aa3c41e95484d7baba5f36 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 911686c76add78cddc6d878e63a3c579fe64a521..ca16b398316c6e827945125238afc884c3b138d8 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index a1e4458f28c745108fc8f62e3853262dfd77cf67..2b1a4e55c7b571ee1274e84935b0597d306cd84e 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 5f122c21f4c0b416d4a84c46f776c014591f59c4..aa8a684c39508b7d59a0f6c1698cb2407cf7c1e2 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 7c9199f321b8b9b65e5ae1e071596714bc1771cd..220f29af7ddc4e80fc6ffd881885ac4d85de2df7 100644 (file)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 2c388962e456bcf6322dd41885c88f7e1a5cddfa..b2c33dbbef74c98c80b73c201ced46648cd0aede 100644 (file)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 2e4d42bbbf321b870e2bd7ea1d625b012ae6701c..4eb457f810bc9cbe886d3936f695a92720c7d315 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index b7223ee585a05f45370e28afc88f7a7225c136f8..69c5c24b2709c727ad1e02f6a5c058f7b94cfcdd 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index dc5c60964c16f41492b8541e1772c45457206218..9292bdce58a248af1c778dae27462c1cb12738c1 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 56f98b1004f51ae8da7304d4f50f376e3eca2b09..ad010e8f624ff181698dfa7d8238284c9adbd243 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 2da736ed14da15017030cce21b590ab18fc9b4f2..763fec2b9adcb04626910353c35467bb85427851 100644 (file)
@@ -1,9 +1,9 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2009 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index f8a2851e72dee15df6b2a0f26460f5bfbcf54bdf..820d22a32a2bdc35483dcdd3af3eaeb47446079a 100644 (file)
@@ -1,11 +1,11 @@
 // { dg-do compile }
 // { dg-options "-std=gnu++0x" }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
 // 2008-07-23 Chris Fairles <chris.fairles@gmail.com>
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 16aed125656d84f09c9048de1b9289ce8809c7ae..3a6992552288f78f9768b3083f1931ea00c9bace 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index e12a706afbccaf06c7634195d5cd74c923951e22..8cf2fc7eac672771754ee4696527564242535762 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index a40fd6ab085fb90fbb5488e4915a640aed3ea6ff..5227341d859f56d0f10a69194075cc88e4e06efd 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 77fead751df6a35140a3a4c833314feda584fecb..35fc0043799a9fef70b23ac0df83d796e48485b9 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 7a5e42d4fb133f91770f5320f474d15d06ba7a83..a39daa82d543233ed90c18d99f61ac4730960107 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 16aed125656d84f09c9048de1b9289ce8809c7ae..3a6992552288f78f9768b3083f1931ea00c9bace 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index e12a706afbccaf06c7634195d5cd74c923951e22..8cf2fc7eac672771754ee4696527564242535762 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 5706bcc191d3ab4c3fac7d64ef77ceea12703e5a..be3386fd55cbf87ad57fa419135422345faf8bb2 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 100a2a76a2982259fe27f3f8455d6f38db29e07a..f0c0d615c3a831718b51d3de51dead744dce6b63 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 049eaa56e1e8bd98a1b1860d267eb15cd17f88ac..e6c7b8d3bd6dc655a17403596380c088427a2545 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index bb0bd0d700c5035ea19887fa38ceb9a91d470144..b0d0075b28371d568a1517e7a6f97a0c15076a1b 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index a5e9581a6fd5761f002d64290ca714a9d0739f63..1e60a54931805846dc8a351809a4dc572c3d3ee8 100644 (file)
@@ -3,9 +3,9 @@
 // { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
 // { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
+// { dg-require-gthreads-timed "" }
 
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
index 46d3ce9e71a439c76a5dfca18d859be19492231a..d5eb5e827ad6caba4f3616dc0df4c29bf701c961 100644 (file)
@@ -134,6 +134,15 @@ proc dg-require-gthreads { args } {
     return
 }
 
+proc dg-require-gthreads-timed { args } {
+    if { ![ check_v3_target_gthreads_timed ] } {
+        upvar dg-do-what dg-do-what
+        set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+        return
+    }
+    return
+}
+
 proc dg-require-nanosleep { args } {
     if { ![ check_v3_target_nanosleep ] } {
         upvar dg-do-what dg-do-what
index d39e8ea182c97bb12533b71deae1931dd61861b0..b510c06126f4b67db01e55333eb3bd8aa0b5205b 100644 (file)
@@ -1299,6 +1299,66 @@ proc check_v3_target_gthreads { } {
     return $et_gthreads
 }
 
+proc check_v3_target_gthreads_timed { } {
+    global cxxflags
+    global DEFAULT_CXXFLAGS
+    global et_gthreads_timed
+
+    global tool
+
+    if { ![info exists et_gthreads_timed_target_name] } {
+        set et_gthreads_timed_target_name ""
+    }
+
+    # If the target has changed since we set the cached value, clear it.
+    set current_target [current_target_name]
+    if { $current_target != $et_gthreads_timed_target_name } {
+        verbose "check_v3_target_gthreads_timed: `$et_gthreads_timed_target_name'" 2
+        set et_gthreads_timed_target_name $current_target
+        if [info exists et_gthreads_timed] {
+            verbose "check_v3_target_gthreads_timed: removing cached result" 2
+            unset et_gthreads_timed
+        }
+    }
+
+    if [info exists et_gthreads_timed] {
+        verbose "check_v3_target_gthreads_timed: using cached result" 2
+    } else {
+        set et_gthreads_timed 0
+
+        # Set up and preprocess a C++0x test program that depends
+        # on the gthreads timed mutex facilities to be available.
+        set src gthreads_timed[pid].cc
+
+        set f [open $src "w"]
+       puts $f "#include <bits/c++config.h>"
+        puts $f "#ifndef _GLIBCXX_HAS_GTHREADS"
+        puts $f "#  error No gthread"
+        puts $f "#endif"
+        puts $f "#if !_GTHREAD_USE_MUTEX_TIMEDLOCK"
+        puts $f "#  error No gthread timed mutexes"
+        puts $f "#endif"
+        close $f
+
+        set cxxflags_saved $cxxflags
+        set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
+
+        set lines [v3_target_compile $src /dev/null preprocess ""]
+        set cxxflags $cxxflags_saved
+        file delete $src
+
+        if [string match "" $lines] {
+            # No error message, preprocessing succeeded.
+            set et_gthreads_timed 1
+        } else {
+            verbose "check_v3_target_gthreads_timed: compilation failed" 2
+        }
+    }
+    verbose "check_v3_target_gthreads_timed: $et_gthreads_timed" 2
+    return $et_gthreads_timed
+}
+
+
 proc check_v3_target_nanosleep { } {
     global cxxflags
     global DEFAULT_CXXFLAGS