diff options
author | Jonathan Wakely <jwakely.gcc@gmail.com> | 2009-05-16 10:09:02 +0000 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2009-05-16 11:09:02 +0100 |
commit | 5c645750962f287f0911c3a78a7b1678971e8f06 (patch) | |
tree | 8b09386ab47b551663c80bdae40a4012984450ac | |
parent | 40a8f07a47f1192d06e895ce1a4d0fc91a723743 (diff) | |
download | gcc-5c645750962f287f0911c3a78a7b1678971e8f06.zip gcc-5c645750962f287f0911c3a78a7b1678971e8f06.tar.gz gcc-5c645750962f287f0911c3a78a7b1678971e8f06.tar.bz2 |
mutex: Move std::lock_error to ...
2009-05-13 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/std/mutex: Move std::lock_error to ...
* src/compatibility.cc: Here.
* src/mutex.cc: Likewise.
* testsuite/30_threads/headers/mutex/types_std_c++0x.cc: Add checks
for lock types and remove std::lock_error check.
From-SVN: r147609
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/std/mutex | 12 | ||||
-rw-r--r-- | libstdc++-v3/src/compatibility.cc | 17 | ||||
-rw-r--r-- | libstdc++-v3/src/mutex.cc | 4 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/30_threads/headers/mutex/types_std_c++0x.cc | 3 |
5 files changed, 27 insertions, 17 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 44db9d8..ea4b256 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2009-05-13 Jonathan Wakely <jwakely.gcc@gmail.com> + + * include/std/mutex: Move std::lock_error to ... + * src/compatibility.cc: Here. + * src/mutex.cc: Likewise. + * testsuite/30_threads/headers/mutex/types_std_c++0x.cc: Add checks + for lock types and remove std::lock_error check. + 2009-05-15 Paolo Carlini <paolo.carlini@oracle.com> * testsuite/21_strings/basic_string/40160.cc: Remove spurious diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index c090608..f313ccb 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -386,18 +386,6 @@ namespace std extern const try_to_lock_t try_to_lock; extern const adopt_lock_t adopt_lock; - /** - * @brief Thrown to indicate errors with lock operations. - * - * @ingroup exceptions - */ - class lock_error : public exception - { - public: - virtual const char* - _GLIBCXX_CONST what() const throw(); - }; - /// @brief Scoped lock idiom. // Acquire the mutex here with a constructor call, then release with // the destructor call in accordance with RAII style. diff --git a/libstdc++-v3/src/compatibility.cc b/libstdc++-v3/src/compatibility.cc index 8889749..6b3c19b 100644 --- a/libstdc++-v3/src/compatibility.cc +++ b/libstdc++-v3/src/compatibility.cc @@ -513,6 +513,23 @@ extern __attribute__((used, weak)) const void * const _ZTIPKe[4] (void *) _ZTSPKe, (void *) 1L, (void *) _ZTIe }; #endif // _GLIBCXX_LONG_DOUBLE_COMPAT +// gcc-4.4.0 +// <mutex> exported std::lock_error +#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) +namespace std +{ + class lock_error : public exception + { + public: + virtual const char* + _GLIBCXX_CONST what() const throw(); + }; + + const char* + lock_error::what() const throw() + { return "std::lock_error"; } +} +#endif #ifdef _GLIBCXX_SYMVER_DARWIN diff --git a/libstdc++-v3/src/mutex.cc b/libstdc++-v3/src/mutex.cc index fcc1eb9..74a82c8 100644 --- a/libstdc++-v3/src/mutex.cc +++ b/libstdc++-v3/src/mutex.cc @@ -43,10 +43,6 @@ namespace std const try_to_lock_t try_to_lock = try_to_lock_t(); const adopt_lock_t adopt_lock = adopt_lock_t(); - const char* - lock_error::what() const throw() - { return "std::lock_error"; } - #ifdef _GLIBCXX_HAVE_TLS __thread void* __once_callable; __thread void (*__once_call)(); diff --git a/libstdc++-v3/testsuite/30_threads/headers/mutex/types_std_c++0x.cc b/libstdc++-v3/testsuite/30_threads/headers/mutex/types_std_c++0x.cc index 5ce994f..604569b 100644 --- a/libstdc++-v3/testsuite/30_threads/headers/mutex/types_std_c++0x.cc +++ b/libstdc++-v3/testsuite/30_threads/headers/mutex/types_std_c++0x.cc @@ -35,7 +35,8 @@ void test01() using std::try_to_lock; using std::adopt_lock; - typedef std::lock_error error_t; + typedef std::lock_guard<mutext_t> lock_t; + typedef std::unique_lock<rmutext_t> ulock_t; typedef std::once_flag once_t; } |