|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78278 - trunk/libs/thread/test/threads/thread/members
From: vicente.botet_at_[hidden]
Date: 2012-04-30 12:04:24
Author: viboes
Date: 2012-04-30 12:04:22 EDT (Mon, 30 Apr 2012)
New Revision: 78278
URL: http://svn.boost.org/trac/boost/changeset/78278
Log:
Thread: Added some traces to catch spourious issue
Text files modified:
trunk/libs/thread/test/threads/thread/members/join_pass.cpp | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
Modified: trunk/libs/thread/test/threads/thread/members/join_pass.cpp
==============================================================================
--- trunk/libs/thread/test/threads/thread/members/join_pass.cpp (original)
+++ trunk/libs/thread/test/threads/thread/members/join_pass.cpp 2012-04-30 12:04:22 EDT (Mon, 30 Apr 2012)
@@ -17,6 +17,7 @@
// void join();
+#define BOOST_THREAD_VESRION 3
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/locks.hpp>
@@ -67,33 +68,52 @@
{
try
{
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
boost::unique_lock<boost::mutex> lk(resource_deadlock_would_occur_mtx);
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
resource_deadlock_would_occur_th->join();
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
BOOST_TEST(false);
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
}
catch (boost::system::system_error& e)
{
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
BOOST_TEST(e.code().value() == boost::system::errc::resource_deadlock_would_occur);
}
+ catch (...)
+ {
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
+ BOOST_TEST(false&&"exception thrown");
+ }
}
int main()
{
{
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
boost::thread t0( (G()));
BOOST_TEST(t0.joinable());
t0.join();
BOOST_TEST(!t0.joinable());
}
{
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
boost::unique_lock<boost::mutex> lk(resource_deadlock_would_occur_mtx);
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
boost::thread t0( resource_deadlock_would_occur_tester );
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
resource_deadlock_would_occur_th = &t0;
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
BOOST_TEST(t0.joinable());
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
lk.unlock();
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
t0.join();
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
BOOST_TEST(!t0.joinable());
+ std::cout << __FILE__ << ":" << __LINE__ <<" " << std::endl;
}
// {
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk