Bug in exception_ptr_test.cpp.

[SVN r79012]
This commit is contained in:
Emil Dotchevski
2012-06-19 20:51:02 +00:00
parent 6fe16d80ef
commit b43961cf94

View File

@ -44,7 +44,7 @@ thread_handle
explicit explicit
thread_handle( boost::function<void()> const & f ): thread_handle( boost::function<void()> const & f ):
t_(boost::bind(thread_wrapper,f,err_)) t_(boost::bind(thread_wrapper,f,boost::ref(err_)))
{ {
} }
@ -63,7 +63,7 @@ void
join( thread_handle & t ) join( thread_handle & t )
{ {
t.t_.join(); t.t_.join();
if( t.err_ ) assert(t.err_);
rethrow_exception(t.err_); rethrow_exception(t.err_);
} }
@ -79,7 +79,9 @@ exc:
++exc_count; ++exc_count;
} }
exc( exc const & ) exc( exc const & e ):
boost::exception(e),
std::exception(e)
{ {
++exc_count; ++exc_count;
} }
@ -109,6 +111,7 @@ check( boost::shared_ptr<thread_handle> const & t )
try try
{ {
join(*t); join(*t);
BOOST_TEST(false);
} }
catch( catch(
exc & e ) exc & e )
@ -125,7 +128,7 @@ main()
try try
{ {
std::vector< boost::shared_ptr<thread_handle> > threads; std::vector< boost::shared_ptr<thread_handle> > threads;
std::generate_n(std::inserter(threads,threads.end()),256,boost::bind(create_thread,thread_func)); std::generate_n(std::inserter(threads,threads.end()),1,boost::bind(create_thread,thread_func));
std::for_each(threads.begin(),threads.end(),check); std::for_each(threads.begin(),threads.end(),check);
return boost::report_errors(); return boost::report_errors();
} }