Committing changes merged from trunk, most notably optional non-intrusive exception_ptr support for MSVC.

[SVN r70974]
This commit is contained in:
Emil Dotchevski
2011-04-04 21:19:48 +00:00
parent 2a2cf697b1
commit ef12c8b8fb
13 changed files with 670 additions and 133 deletions

View File

@ -10,6 +10,7 @@
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <boost/detail/atomic_count.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <iostream>
@ -66,7 +67,34 @@ join( thread_handle & t )
rethrow_exception(t.err_);
}
struct exc: boost::exception, std::exception { };
boost::detail::atomic_count exc_count(0);
struct
exc:
virtual boost::exception,
virtual std::exception
{
exc()
{
++exc_count;
}
exc( exc const & )
{
++exc_count;
}
virtual
~exc() throw()
{
--exc_count;
}
private:
exc & operator=( exc const & );
};
typedef boost::error_info<struct answer_,int> answer;
void
@ -93,6 +121,7 @@ check( boost::shared_ptr<thread_handle> const & t )
int
main()
{
BOOST_TEST(++exc_count==1);
try
{
std::vector< boost::shared_ptr<thread_handle> > threads;
@ -109,4 +138,5 @@ main()
boost::current_exception_diagnostic_information() << std::endl;
return 42;
}
BOOST_TEST(!--exc_count);
}