Commit 3442f18d by Jonathan Wakely Committed by Jonathan Wakely

re PR libstdc++/56002 ([C++11] allow generic locks to be used without requiring…

re PR libstdc++/56002 ([C++11] allow generic locks to be used without requiring plattform support for threads)

	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: r196706
parent b722c9a2
2013-03-16 Jonathan Wakely <jwakely.gcc@gmail.com> 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-16 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/56492 PR libstdc++/56492
* include/std/future (__future_base::_Result): Add result_type * include/std/future (__future_base::_Result): Add result_type
typedef. typedef.
......
...@@ -45,12 +45,13 @@ ...@@ -45,12 +45,13 @@
#include <bits/gthr.h> #include <bits/gthr.h>
#include <bits/move.h> // for std::swap #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) namespace std _GLIBCXX_VISIBILITY(default)
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
#ifdef _GLIBCXX_HAS_GTHREADS
// Common base class for std::mutex and std::timed_mutex // Common base class for std::mutex and std::timed_mutex
class __mutex_base class __mutex_base
{ {
...@@ -384,6 +385,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -384,6 +385,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
}; };
#endif #endif
#endif // _GLIBCXX_HAS_GTHREADS
/// Do not acquire ownership of the mutex. /// Do not acquire ownership of the mutex.
struct defer_lock_t { }; struct defer_lock_t { };
...@@ -719,6 +721,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -719,6 +721,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
} }
#ifdef _GLIBCXX_HAS_GTHREADS
/// once_flag /// once_flag
struct once_flag struct once_flag
{ {
...@@ -790,12 +793,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -790,12 +793,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
if (__e) if (__e)
__throw_system_error(__e); __throw_system_error(__e);
} }
#endif // _GLIBCXX_HAS_GTHREADS
// @} group mutexes // @} group mutexes
_GLIBCXX_END_NAMESPACE_VERSION _GLIBCXX_END_NAMESPACE_VERSION
} // namespace } // namespace
#endif // _GLIBCXX_USE_C99_STDINT_TR1
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
#endif // C++11 #endif // C++11
......
// { dg-do run { target *-*-freebsd* *-*-netbsd* *-*-linux* *-*-solaris* *-*-cygwin *-*-darwin* powerpc-ibm-aix* } } // { dg-do run }
// { dg-options " -std=gnu++0x -pthread" { target *-*-freebsd* *-*-netbsd* *-*-linux* powerpc-ibm-aix* } } // { dg-options " -std=gnu++11 " }
// { dg-options " -std=gnu++0x -pthreads" { target *-*-solaris* } }
// { dg-options " -std=gnu++0x " { target *-*-cygwin *-*-darwin* } }
// { dg-require-cstdint "" } // { dg-require-cstdint "" }
// { dg-require-gthreads "" }
// Copyright (C) 2010-2013 Free Software Foundation, Inc. // Copyright (C) 2010-2013 Free Software Foundation, Inc.
// //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment