Commit 726d3136 by Jonathan Wakely Committed by Jonathan Wakely

mutex (try_lock): Do not swallow exceptions.

	* include/std/mutex (try_lock): Do not swallow exceptions.
	* testsuite/30_threads/try_lock/4.cc: Fix test.

From-SVN: r215467
parent ed26fe9e
2014-09-22 Jonathan Wakely <jwakely@redhat.com> 2014-09-22 Jonathan Wakely <jwakely@redhat.com>
* include/std/mutex (try_lock): Do not swallow exceptions.
* testsuite/30_threads/try_lock/4.cc: Fix test.
2014-09-22 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/54316 PR libstdc++/54316
PR libstdc++/53626 PR libstdc++/53626
* config/abi/pre/gnu.ver: Add new exports. * config/abi/pre/gnu.ver: Add new exports.
......
...@@ -630,12 +630,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -630,12 +630,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ {
int __idx; int __idx;
auto __locks = std::tie(__l1, __l2, __l3...); auto __locks = std::tie(__l1, __l2, __l3...);
__try __try_lock_impl<0>::__do_try_lock(__locks, __idx);
{ __try_lock_impl<0>::__do_try_lock(__locks, __idx); }
__catch(const __cxxabiv1::__forced_unwind&)
{ __throw_exception_again; }
__catch(...)
{ }
return __idx; return __idx;
} }
......
...@@ -133,8 +133,15 @@ void test03() ...@@ -133,8 +133,15 @@ void test03()
while (unreliable_lock::throw_on < 3) while (unreliable_lock::throw_on < 3)
{ {
unreliable_lock::count = 0; unreliable_lock::count = 0;
int failed = std::try_lock(l1, l2, l3); try
VERIFY( failed == unreliable_lock::throw_on ); {
std::try_lock(l1, l2, l3);
VERIFY( false );
}
catch (int e)
{
VERIFY( e == unreliable_lock::throw_on );
}
++unreliable_lock::throw_on; ++unreliable_lock::throw_on;
} }
} }
......
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