mirror of
https://github.com/boostorg/exception.git
synced 2025-07-29 12:07:20 +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>
|
#include <boost/core/demangle.hpp>
|
||||||
#endif
|
#endif
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <boost/make_shared.hpp>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <ios>
|
#include <ios>
|
||||||
@ -81,8 +82,9 @@ boost
|
|||||||
exception_ptr
|
exception_ptr
|
||||||
copy_exception( E const & e )
|
copy_exception( E const & e )
|
||||||
{
|
{
|
||||||
wrapexcept<E> * w = new wrapexcept<E>(e);
|
E cp = e;
|
||||||
return exception_ptr(shared_ptr<wrapexcept<E> >(w));
|
exception_detail::copy_boost_exception(&cp, &e);
|
||||||
|
return exception_ptr(boost::make_shared<wrapexcept<E> >(cp));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
@ -110,7 +110,7 @@ void
|
|||||||
thread_test()
|
thread_test()
|
||||||
{
|
{
|
||||||
boost::thread_group grp;
|
boost::thread_group grp;
|
||||||
for( int i=0; i!=50; ++i )
|
for( int i=0; i!=100; ++i )
|
||||||
grp.create_thread(&consume);
|
grp.create_thread(&consume);
|
||||||
grp.join_all ();
|
grp.join_all ();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user