]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libstdc++/56002 ([C++11] allow generic locks to be used without requiring platt...
authorJonathan Wakely <jwakely.gcc@gmail.com>
Sat, 16 Mar 2013 20:22:30 +0000 (20:22 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Sat, 16 Mar 2013 20:22:30 +0000 (20:22 +0000)
PR libstdc++/56002
* include/std/mutex (lock_guard, unique_lock, lock): Define without
depending on _GLIBCXX_HAS_GTHREADS.
* testsuite/30_threads/lock_guard/cons/1.cc: Run on all targets.

From-SVN: r196710

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/mutex
libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc

index 133dbc9c83fdb397729e37c73ce5e32b07d689f5..21444d81ba74ee8bd0ea312162812ba55e093b62 100644 (file)
@@ -1,3 +1,10 @@
+2013-03-16  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       PR libstdc++/56002
+       * include/std/mutex (lock_guard, unique_lock, lock): Define without
+       depending on _GLIBCXX_HAS_GTHREADS.
+       * testsuite/30_threads/lock_guard/cons/1.cc: Run on all targets.
+
 2013-03-09  François Dumont  <fdumont@gcc.gnu.org>
 
        * include/bits/vector.tcc (vector<>operator=(const vector<>&):
index 34d64c5b65f2f8ab9f79124427419e0bd18d7798..fc9691971c6093979a60664197e3c52b9ac8e1d0 100644 (file)
@@ -1,6 +1,6 @@
 // <mutex> -*- C++ -*-
 
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 #include <bits/gthr.h>
 #include <bits/move.h> // for std::swap
 
-#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
+#ifdef _GLIBCXX_USE_C99_STDINT_TR1
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+#ifdef _GLIBCXX_HAS_GTHREADS
   // Common base class for std::mutex and std::timed_mutex
   class __mutex_base
   {
@@ -420,6 +421,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       }
   };
 #endif
+#endif // _GLIBCXX_HAS_GTHREADS
 
   /// Do not acquire ownership of the mutex.
   struct defer_lock_t { };
@@ -755,6 +757,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
         }
     }
 
+#ifdef _GLIBCXX_HAS_GTHREADS
   /// once_flag
   struct once_flag
   {
@@ -826,12 +829,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       if (__e)
        __throw_system_error(__e);
     }
+#endif // _GLIBCXX_HAS_GTHREADS
 
   // @} group mutexes
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace
 
-#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+#endif // _GLIBCXX_USE_C99_STDINT_TR1
 
 #endif // __GXX_EXPERIMENTAL_CXX0X__
 
index c135e28e48bd228f645db075fd110f5114b6200a..470fc4c49c43ef738939b96ed266e3f30b139189 100644 (file)
@@ -1,11 +1,8 @@
-// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* alpha*-*-osf* mips-sgi-irix6* powerpc-ibm-aix* } }
-// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
-// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
+// { dg-do run }
+// { dg-options " -std=gnu++11 " }
 // { dg-require-cstdint "" }
-// { dg-require-gthreads "" }
 
-// Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
+// Copyright (C) 2010, 2011, 2012, 2013 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