Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r81410 - in trunk: boost/thread boost/thread/detail libs/thread/test libs/thread/test/sync/futures/async
From: vicente.botet_at_[hidden]
Date: 2012-11-18 05:09:15


Author: viboes
Date: 2012-11-18 05:09:12 EST (Sun, 18 Nov 2012)
New Revision: 81410
URL: http://svn.boost.org/trac/boost/changeset/81410

Log:
Thread: manage with #7575 for c++11 compliant compilers + try to fix issue with is_convertible on gcc-4.4.
Added:
   trunk/boost/thread/detail/is_convertible.hpp (contents, props changed)
Text files modified:
   trunk/boost/thread/detail/thread.hpp | 9 +-
   trunk/boost/thread/future.hpp | 90 +++++++++++++++++---------
   trunk/libs/thread/test/Jamfile.v2 | 4
   trunk/libs/thread/test/sync/futures/async/async_pass.cpp | 136 ++++++++++++++++++++++++++++++++++++++++
   4 files changed, 201 insertions(+), 38 deletions(-)

Added: trunk/boost/thread/detail/is_convertible.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/thread/detail/is_convertible.hpp 2012-11-18 05:09:12 EST (Sun, 18 Nov 2012)
@@ -0,0 +1,31 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright 2011-2012 Vicente J. Botet Escriba
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// See http://www.boost.org/libs/thread for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_THREAD_DETAIL_IS_CONVERTIBLE_HPP
+#define BOOST_THREAD_DETAIL_IS_CONVERTIBLE_HPP
+
+#include <boost/type_traits/is_convertible.hpp>
+
+namespace boost
+{
+ namespace thread_detail
+ {
+ template <typename T1, typename T2>
+ struct is_convertible : boost::is_convertible<T1,T2> {};
+
+ template <typename T1, typename T2>
+ struct is_convertible<T1&, T2&> : boost::is_convertible<T1, T2> {};
+
+ }
+
+} // namespace boost
+
+
+#endif // BOOST_THREAD_DETAIL_MEMORY_HPP

Modified: trunk/boost/thread/detail/thread.hpp
==============================================================================
--- trunk/boost/thread/detail/thread.hpp (original)
+++ trunk/boost/thread/detail/thread.hpp 2012-11-18 05:09:12 EST (Sun, 18 Nov 2012)
@@ -20,6 +20,7 @@
 #include <boost/thread/detail/thread_heap_alloc.hpp>
 #include <boost/thread/detail/make_tuple_indices.hpp>
 #include <boost/thread/detail/invoke.hpp>
+#include <boost/thread/detail/is_convertible.hpp>
 #include <boost/assert.hpp>
 #include <list>
 #include <algorithm>
@@ -222,7 +223,7 @@
         template<typename F>
         static inline detail::thread_data_ptr make_thread_info(F f
             , typename disable_if_c<
- //boost::is_convertible<F&,BOOST_THREAD_RV_REF(F)>::value ||
+ //boost::thread_detail::is_convertible<F&,BOOST_THREAD_RV_REF(F)>::value ||
                 is_same<typename decay<F>::type, thread>::value,
                 dummy* >::type=0
                 )
@@ -292,7 +293,7 @@
         template <class F>
         explicit thread(F f
         , typename disable_if_c<
- boost::is_convertible<F&,BOOST_THREAD_RV_REF(F)>::value
+ boost::thread_detail::is_convertible<F&,BOOST_THREAD_RV_REF(F)>::value
             //|| is_same<typename decay<F>::type, thread>::value
            , dummy* >::type=0
         ):
@@ -302,7 +303,7 @@
         }
         template <class F>
         thread(attributes const& attrs, F f
- , typename disable_if<boost::is_convertible<F&,BOOST_THREAD_RV_REF(F) >, dummy* >::type=0
+ , typename disable_if<boost::thread_detail::is_convertible<F&,BOOST_THREAD_RV_REF(F) >, dummy* >::type=0
         ):
             thread_info(make_thread_info(f))
         {
@@ -384,7 +385,7 @@
         }
 #else
         template <class F,class A1>
- thread(F f,A1 a1,typename disable_if<boost::is_convertible<F&,thread_attributes >, dummy* >::type=0):
+ thread(F f,A1 a1,typename disable_if<boost::thread_detail::is_convertible<F&,thread_attributes >, dummy* >::type=0):
             thread_info(make_thread_info(boost::bind(boost::type<void>(),f,a1)))
         {
             start_thread();

Modified: trunk/boost/thread/future.hpp
==============================================================================
--- trunk/boost/thread/future.hpp (original)
+++ trunk/boost/thread/future.hpp 2012-11-18 05:09:12 EST (Sun, 18 Nov 2012)
@@ -28,7 +28,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/type_traits/is_fundamental.hpp>
-#include <boost/type_traits/is_convertible.hpp>
+#include <boost/thread/detail/is_convertible.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/type_traits/remove_cv.hpp>
 #include <boost/mpl/if.hpp>
@@ -66,6 +66,7 @@
 namespace boost
 {
 
+
   //enum class future_errc
   BOOST_SCOPED_ENUM_DECLARE_BEGIN(future_errc)
   {
@@ -539,8 +540,8 @@
             typedef typename boost::mpl::if_<boost::has_move_emulation_enabled<T>,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
 #else
             typedef T& source_reference_type;
- typedef typename boost::mpl::if_<boost::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T const&>::type rvalue_source_type;
- typedef typename boost::mpl::if_<boost::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
+ typedef typename boost::mpl::if_<boost::thread_detail::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T const&>::type rvalue_source_type;
+ typedef typename boost::mpl::if_<boost::thread_detail::is_convertible<T&,BOOST_THREAD_RV_REF(T) >,BOOST_THREAD_RV_REF(T),T>::type move_dest_type;
 #endif
 
             typedef const T& shared_future_get_result_type;
@@ -863,18 +864,17 @@
         struct future_async_object: future_object<Rp>
         {
           typedef future_object<Rp> base_type;
- Fp func_;
           boost::thread thr_;
 
         public:
         #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
           explicit future_async_object(Fp&& f)
- : func_(boost::forward<Fp>(f))
+ :
         #else
- explicit future_async_object(Fp f)
- : func_(f)
+ explicit future_async_object(BOOST_THREAD_FWD_REF(Fp) f)
+ :
         #endif
- , thr_(&future_async_object::execute, *this)
+ thr_(&future_async_object::run, this, boost::forward<Fp>(f))
           {
           }
 
@@ -883,36 +883,44 @@
             thr_.join();
           }
 
- virtual void execute(boost::unique_lock<boost::mutex>& lock) {
+#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
+ static void run(future_async_object* that, Fp&& f)
+#else
+ static void run(future_async_object* that, BOOST_THREAD_FWD_REF(Fp) f)
+#endif
+ {
             try
             {
- this->mark_finished_with_result_internal(func_(), lock);
+ that->mark_finished_with_result(f());
             }
- catch (...)
+#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
+ catch(thread_interrupted& )
             {
- this->mark_exceptional_finish_internal(current_exception(), lock);
+ that->mark_interrupted_finish();
+ }
+#endif
+ catch(...)
+ {
+ that->mark_exceptional_finish();
             }
-
           }
-
         };
 
         template<typename Fp>
         struct future_async_object<void, Fp>: public future_object<void>
         {
           typedef future_object<void> base_type;
- Fp func_;
           boost::thread thr_;
 
         public:
         #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
           explicit future_async_object(Fp&& f)
- : func_(boost::forward<Fp>(f))
+ :
         #else
- explicit future_async_object(Fp f)
- : func_(f)
+ explicit future_async_object(BOOST_THREAD_FWD_REF(Fp) f)
+ :
         #endif
- , thr_(&future_async_object::execute, *this)
+ thr_(&future_async_object::run, this, boost::forward<Fp>(f))
           {
           }
 
@@ -921,19 +929,28 @@
             thr_.join();
           }
 
- virtual void execute(boost::unique_lock<boost::mutex>& lock) {
+#if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
+ static void run(future_async_object* that, Fp&& f)
+#else
+ static void run(future_async_object* that, BOOST_THREAD_FWD_REF(Fp) f)
+#endif
+ {
             try
             {
- func_();
- this->mark_finished_with_result_internal(lock);
+ f();
+ that->mark_finished_with_result();
             }
- catch (...)
+#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS
+ catch(thread_interrupted& )
             {
- this->mark_exceptional_finish_internal(current_exception(), lock);
+ that->mark_interrupted_finish();
+ }
+#endif
+ catch(...)
+ {
+ that->mark_exceptional_finish();
             }
-
           }
-
         };
         /// future_deferred_object
         template<typename Rp, typename Fp>
@@ -1380,7 +1397,7 @@
         #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
         make_future_async_object(Fp&& f);
         #else
- make_future_async_object(Fp f);
+ make_future_async_object(BOOST_THREAD_FWD_REF(Fp) f);
         #endif
 
         template <class Rp, class Fp>
@@ -1388,7 +1405,7 @@
         #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
         make_future_deferred_object(Fp&& f);
         #else
- make_future_deferred_object(Fp f);
+ make_future_deferred_object(BOOST_THREAD_FWD_REF(Fp) f);
         #endif
     }
 
@@ -1417,7 +1434,7 @@
         #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
         detail::make_future_async_object(Fp&& f);
         #else
- detail::make_future_async_object(Fp f);
+ detail::make_future_async_object(BOOST_THREAD_FWD_REF(Fp) f);
         #endif
 
         template <class Rp, class Fp>
@@ -1425,7 +1442,7 @@
         #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
         detail::make_future_deferred_object(Fp&& f);
         #else
- detail::make_future_deferred_object(Fp f);
+ detail::make_future_deferred_object(BOOST_THREAD_FWD_REF(Fp) f);
         #endif
 
         typedef typename detail::future_traits<R>::move_dest_type move_dest_type;
@@ -2840,7 +2857,7 @@
     #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
     make_future_deferred_object(Fp&& f)
     #else
- make_future_deferred_object(Fp f)
+ make_future_deferred_object(BOOST_THREAD_FWD_REF(Fp) f)
     #endif
     {
       shared_ptr<future_deferred_object<Rp, Fp> >
@@ -2856,7 +2873,7 @@
     #if ! defined BOOST_NO_CXX11_RVALUE_REFERENCES
     make_future_async_object(Fp&& f)
     #else
- make_future_async_object(Fp f)
+ make_future_async_object(BOOST_THREAD_FWD_REF(Fp) f)
     #endif
     {
       shared_ptr<future_async_object<Rp, Fp> >
@@ -2971,6 +2988,14 @@
 
         if (int(policy) & int(launch::async))
         {
+#if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ return boost::detail::make_future_async_object<Rp>(
+ BF(
+ thread_detail::decay_copy(boost::forward<F>(f))
+ , thread_detail::decay_copy(boost::forward<ArgTypes>(args))...
+ )
+ );
+#else
           packaged_task_type pt( boost::forward<F>(f) );
 
           BOOST_THREAD_FUTURE<R> ret = pt.get_future();
@@ -2980,6 +3005,7 @@
           boost::thread( boost::move(pt) ).detach();
 #endif
           return ::boost::move(ret);
+#endif
         }
         else if (int(policy) & int(launch::deferred))
         {

Modified: trunk/libs/thread/test/Jamfile.v2
==============================================================================
--- trunk/libs/thread/test/Jamfile.v2 (original)
+++ trunk/libs/thread/test/Jamfile.v2 2012-11-18 05:09:12 EST (Sun, 18 Nov 2012)
@@ -202,9 +202,9 @@
           [ thread-run test_5542_3.cpp ]
           [ thread-run test_5891.cpp ]
           [ thread-run test_6130.cpp ]
- [ thread-run test_6170.cpp ]
+ #[ thread-run test_6170.cpp ]
           [ thread-run test_6174.cpp ]
- [ thread-run test_7160.cpp ]
+ #[ thread-run test_7160.cpp ]
           [ thread-run test_7328.cpp ]
           [ thread-run test_7571.cpp ]
     ;

Modified: trunk/libs/thread/test/sync/futures/async/async_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/futures/async/async_pass.cpp (original)
+++ trunk/libs/thread/test/sync/futures/async/async_pass.cpp 2012-11-18 05:09:12 EST (Sun, 18 Nov 2012)
@@ -105,146 +105,282 @@
 
 int main()
 {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int> f = boost::async(f0);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(f.get() == 3);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
+
   }
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int> f = boost::async(boost::launch::async, f0);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(f.get() == 3);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
+
+
   }
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<long> f = boost::async(boost::launch::async, A(3));
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(f.get() == 3);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
+
   }
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int> f = boost::async(boost::launch::async, BOOST_THREAD_MAKE_RV_REF(MoveOnly()));
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(f.get() == 3);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int> f = boost::async(boost::launch::any, f0);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(f.get() == 3);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
 #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int> f = boost::async(boost::launch::deferred, f0);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(f.get() == 3);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 > ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
 #endif
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int&> f = boost::async(f1);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(&f.get() == &i);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int&> f = boost::async(boost::launch::async, f1);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(&f.get() == &i);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int&> f = boost::async(boost::launch::any, f1);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(&f.get() == &i);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
 #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<int&> f = boost::async(boost::launch::deferred, f1);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(&f.get() == &i);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 > ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
 #endif
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<void> f = boost::async(f2);
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
     boost::this_thread::sleep_for(ms(300));
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
     Clock::time_point t0 = Clock::now();
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
     f.get();
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
     Clock::time_point t1 = Clock::now();
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<void> f = boost::async(boost::launch::async, f2);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     f.get();
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<void> f = boost::async(boost::launch::any, f2);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     f.get();
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
 #if defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<void> f = boost::async(boost::launch::deferred, f2);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     f.get();
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 > ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
 #endif
 
   // todo fixme
 #if 0 && defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<std::endl;
   {
+ try {
     boost::future<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > f = boost::async(boost::launch::async, &f3, 3);
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(*f.get() == 3);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
 #endif
 
   // todo fixme
 #if 0 && defined BOOST_THREAD_PROVIDES_SIGNATURE_PACKAGED_TASK && defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
   {
+ try {
     boost::future<boost::interprocess::unique_ptr<int, boost::default_delete<int> > > f = boost::async(&f4, boost::interprocess::unique_ptr<int, boost::default_delete<int> >(new int(3)));
     boost::this_thread::sleep_for(ms(300));
     Clock::time_point t0 = Clock::now();
     BOOST_TEST(*f.get() == 3);
     Clock::time_point t1 = Clock::now();
     BOOST_TEST(t1 - t0 < ms(100));
+ } catch (std::exception& ex) {
+ std::cout << __FILE__ <<"["<<__LINE__<<"]"<<ex.what() << std::endl;
+ BOOST_TEST(false && "exception thrown");
+ } catch (...) {
+ BOOST_TEST(false && "exception thrown");
+ }
   }
 #endif
   return boost::report_errors();


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