summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-01 12:34:10 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-10-01 12:34:10 +0000
commitb14c3ddd1b8749827e97a72b0ccb84fc2d5edc15 (patch)
treeb8846cfc9da39aa7cfa941ad8b2fa2da3db5a631 /libstdc++-v3
parent9b574f1ece055ed1ad5ba32bc9ce570e9d9e2b29 (diff)
downloadppe42-gcc-b14c3ddd1b8749827e97a72b0ccb84fc2d5edc15.tar.gz
ppe42-gcc-b14c3ddd1b8749827e97a72b0ccb84fc2d5edc15.zip
* include/std/mutex (try_lock): Do not swallow exceptions.
* testsuite/30_threads/try_lock/4.cc: Fix test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@215755 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/std/mutex7
-rw-r--r--libstdc++-v3/testsuite/30_threads/try_lock/4.cc11
3 files changed, 15 insertions, 8 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 00203680fcb..6f342566786 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,10 @@
2014-10-01 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/mutex (try_lock): Do not swallow exceptions.
+ * testsuite/30_threads/try_lock/4.cc: Fix test.
+
+2014-10-01 Jonathan Wakely <jwakely@redhat.com>
+
PR libstdc++/59603
* include/bits/stl_algo.h (random_shuffle): Prevent self-swapping.
* testsuite/25_algorithms/random_shuffle/59603.cc: New.
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index 8e9dd27e2b9..c6b7f1373fa 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -648,12 +648,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
int __idx;
auto __locks = std::tie(__l1, __l2, __l3...);
- __try
- { __try_lock_impl<0>::__do_try_lock(__locks, __idx); }
- __catch(const __cxxabiv1::__forced_unwind&)
- { __throw_exception_again; }
- __catch(...)
- { }
+ __try_lock_impl<0>::__do_try_lock(__locks, __idx);
return __idx;
}
diff --git a/libstdc++-v3/testsuite/30_threads/try_lock/4.cc b/libstdc++-v3/testsuite/30_threads/try_lock/4.cc
index de9b69eef9e..86fe14e29a1 100644
--- a/libstdc++-v3/testsuite/30_threads/try_lock/4.cc
+++ b/libstdc++-v3/testsuite/30_threads/try_lock/4.cc
@@ -133,8 +133,15 @@ void test03()
while (unreliable_lock::throw_on < 3)
{
unreliable_lock::count = 0;
- int failed = std::try_lock(l1, l2, l3);
- VERIFY( failed == unreliable_lock::throw_on );
+ try
+ {
+ std::try_lock(l1, l2, l3);
+ VERIFY( false );
+ }
+ catch (int e)
+ {
+ VERIFY( e == unreliable_lock::throw_on );
+ }
++unreliable_lock::throw_on;
}
}
OpenPOWER on IntegriCloud