|
Boost-Commit : |
From: john_at_[hidden]
Date: 2007-11-14 08:03:15
Author: johnmaddock
Date: 2007-11-14 08:03:15 EST (Wed, 14 Nov 2007)
New Revision: 41089
URL: http://svn.boost.org/trac/boost/changeset/41089
Log:
Catch exceptions thrown from thread creation.
Text files modified:
trunk/libs/regex/test/regress/main.cpp | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
Modified: trunk/libs/regex/test/regress/main.cpp
==============================================================================
--- trunk/libs/regex/test/regress/main.cpp (original)
+++ trunk/libs/regex/test/regress/main.cpp 2007-11-14 08:03:15 EST (Wed, 14 Nov 2007)
@@ -75,7 +75,13 @@
std::list<boost::shared_ptr<boost::thread> > threads;
for(int i = 0; i < 5; ++i)
{
- threads.push_back(boost::shared_ptr<boost::thread>(new boost::thread(&run_tests)));
+ try{
+ threads.push_back(boost::shared_ptr<boost::thread>(new boost::thread(&run_tests)));
+ }
+ catch(const std::exception& e)
+ {
+ std::cerr << "<note>Thread creation failed with message: " << e.what() << "</note>" << std::endl;
+ }
}
std::list<boost::shared_ptr<boost::thread> >::const_iterator a(threads.begin()), b(threads.end());
while(a != b)
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