mirror of
https://github.com/boostorg/exception.git
synced 2025-07-29 03:57:18 +02:00
Fixed multi-thread bug introduced by the previous change to copy_exception.
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
#include <boost/core/demangle.hpp>
|
||||
#endif
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <stdexcept>
|
||||
#include <new>
|
||||
#include <ios>
|
||||
@ -81,8 +82,9 @@ boost
|
||||
exception_ptr
|
||||
copy_exception( E const & e )
|
||||
{
|
||||
wrapexcept<E> * w = new wrapexcept<E>(e);
|
||||
return exception_ptr(shared_ptr<wrapexcept<E> >(w));
|
||||
E cp = e;
|
||||
exception_detail::copy_boost_exception(&cp, &e);
|
||||
return exception_ptr(boost::make_shared<wrapexcept<E> >(cp));
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
@ -110,7 +110,7 @@ void
|
||||
thread_test()
|
||||
{
|
||||
boost::thread_group grp;
|
||||
for( int i=0; i!=50; ++i )
|
||||
for( int i=0; i!=100; ++i )
|
||||
grp.create_thread(&consume);
|
||||
grp.join_all ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user