Patchwork [v3] libstdc++/50196 - enable std::thread, std::mutex etc. on darwin

login
register
mail settings
Submitter Jonathan Wakely
Date Oct. 20, 2011, 11:43 p.m.
Message ID <CAH6eHdSLykO5wdDKs-V3YLrxLy-giZiXsSGNf_WrSap5rVuz6g@mail.gmail.com>
Download mbox | patch
Permalink /patch/120915/
State New
Headers show

Comments

Jonathan Wakely - Oct. 20, 2011, 11:43 p.m.
This patch should enable macosx support for <thread> and partial
support for <mutex>, by defining _GLIBCXX_HAS_GTHREADS on POSIX
systems without the _POSIX_TIMEOUTS option, and only disabling the
types which rely on the Timeouts option, std::timed_mutex and
std::recursive_timed_mutex, instead of disabling all thread support.

Paolo, Jakub, I'd appreciate it if you two could check this over, as
you were responsible for some of this autoconf stuff, via
http://gcc.gnu.org/PR49745

I've only tested this on x86-64-linux where everything is supported
anyway, but I did tweak the configure test for _POSIX_TIMEOUTS to
fail, so I could check the tests were correctly disabled when
_GTHREADS_HAS_MUTEX_TIMEDLOCK is zero.

If anyone can test this on darwin I'd be very grateful (you'll need to
run autoreconf in the libstdc++-v3 directory to regenerate configure
and config.h.in, or contact me and I'll mail you the regenerated
files)

ChangeLog:

        * acinclude.m4 (GTHREADS_HAS_MUTEX_TIMEDLOCK): Don't depend on
_POSIX_TIMEOUTS.
        * configure: Regenerate.
        * config.h.in: 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.
Jonathan Wakely - Oct. 21, 2011, 8:15 a.m.
On 21 October 2011 00:43, Jonathan Wakely wrote:
> This patch should enable macosx support for <thread> and partial
> support for <mutex>, by defining _GLIBCXX_HAS_GTHREADS on POSIX
> systems without the _POSIX_TIMEOUTS option, and only disabling the
> types which rely on the Timeouts option, std::timed_mutex and
> std::recursive_timed_mutex, instead of disabling all thread support.

I've just realised this patch will disable the timed mutexes on
non-posix platforms - I should only check for _POSIX_TIMEOUTS when
thread-model = posix, and set HAS_MUTEX_TIMEDLOCK unconditionally
elsewhere.

New patch coming soon...

Patch

Index: acinclude.m4
===================================================================
--- acinclude.m4	(revision 180278)
+++ acinclude.m4	(working copy)
@@ -3358,7 +3358,7 @@ 
   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])
+  AC_MSG_CHECKING([whether it can be safely assumed that mutex_timedlock is available])
 
   AC_TRY_COMPILE([#include <unistd.h>],
     [
@@ -3382,20 +3382,11 @@ 
 
   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: include/std/mutex
===================================================================
--- include/std/mutex	(revision 180278)
+++ include/std/mutex	(working copy)
@@ -206,6 +206,7 @@ 
     { return &_M_mutex; }
   };
 
+#if _GTHREAD_USE_MUTEX_TIMEDLOCK
   /// timed_mutex
   class timed_mutex
   {
@@ -417,6 +418,7 @@ 
 	return try_lock_until(__atime);
       }
   };
+#endif
 
   /// Do not acquire ownership of the mutex.
   struct defer_lock_t { };
Index: testsuite/lib/libstdc++.exp
===================================================================
--- testsuite/lib/libstdc++.exp	(revision 180278)
+++ testsuite/lib/libstdc++.exp	(working copy)
@@ -1299,6 +1299,66 @@ 
     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
Index: testsuite/lib/dg-options.exp
===================================================================
--- testsuite/lib/dg-options.exp	(revision 180278)
+++ testsuite/lib/dg-options.exp	(working copy)
@@ -134,6 +134,15 @@ 
     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: testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/cons/assign_neg.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/cons/1.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/cons/1.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/cons/1.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/cons/copy_neg.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/requirements/typedefs.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/lock/1.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/lock/1.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/lock/1.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/lock/2.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/lock/2.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/lock/2.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/unlock/1.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/unlock/1.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/unlock/1.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc	(working copy)
@@ -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: testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc
===================================================================
--- testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc	(revision 180278)
+++ testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/dest/destructor_locked.cc
===================================================================
--- testsuite/30_threads/timed_mutex/dest/destructor_locked.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/dest/destructor_locked.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/native_handle/typesizes.cc
===================================================================
--- testsuite/30_threads/timed_mutex/native_handle/typesizes.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/native_handle/typesizes.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/native_handle/1.cc
===================================================================
--- testsuite/30_threads/timed_mutex/native_handle/1.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/native_handle/1.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/try_lock_until/1.cc
===================================================================
--- testsuite/30_threads/timed_mutex/try_lock_until/1.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/try_lock_until/1.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/try_lock_until/2.cc
===================================================================
--- testsuite/30_threads/timed_mutex/try_lock_until/2.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/try_lock_until/2.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/cons/assign_neg.cc
===================================================================
--- testsuite/30_threads/timed_mutex/cons/assign_neg.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/cons/assign_neg.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/cons/1.cc
===================================================================
--- testsuite/30_threads/timed_mutex/cons/1.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/cons/1.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/cons/copy_neg.cc
===================================================================
--- testsuite/30_threads/timed_mutex/cons/copy_neg.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/cons/copy_neg.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/requirements/standard_layout.cc
===================================================================
--- testsuite/30_threads/timed_mutex/requirements/standard_layout.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/requirements/standard_layout.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/requirements/typedefs.cc
===================================================================
--- testsuite/30_threads/timed_mutex/requirements/typedefs.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/requirements/typedefs.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/try_lock/1.cc
===================================================================
--- testsuite/30_threads/timed_mutex/try_lock/1.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/try_lock/1.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/try_lock/2.cc
===================================================================
--- testsuite/30_threads/timed_mutex/try_lock/2.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/try_lock/2.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/lock/1.cc
===================================================================
--- testsuite/30_threads/timed_mutex/lock/1.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/lock/1.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/unlock/1.cc
===================================================================
--- testsuite/30_threads/timed_mutex/unlock/1.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/unlock/1.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/try_lock_for/1.cc
===================================================================
--- testsuite/30_threads/timed_mutex/try_lock_for/1.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/try_lock_for/1.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/try_lock_for/2.cc
===================================================================
--- testsuite/30_threads/timed_mutex/try_lock_for/2.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/try_lock_for/2.cc	(working copy)
@@ -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: testsuite/30_threads/timed_mutex/try_lock_for/3.cc
===================================================================
--- testsuite/30_threads/timed_mutex/try_lock_for/3.cc	(revision 180278)
+++ testsuite/30_threads/timed_mutex/try_lock_for/3.cc	(working copy)
@@ -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