Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52519 - sandbox/task/boost/task
From: oliver.kowalke_at_[hidden]
Date: 2009-04-20 16:40:47


Author: olli
Date: 2009-04-20 16:40:47 EDT (Mon, 20 Apr 2009)
New Revision: 52519
URL: http://svn.boost.org/trac/boost/changeset/52519

Log:
* return a handle from task

Text files modified:
   sandbox/task/boost/task/handle.hpp | 16 +++-------------
   sandbox/task/boost/task/task.hpp | 16 +++-------------
   2 files changed, 6 insertions(+), 26 deletions(-)

Modified: sandbox/task/boost/task/handle.hpp
==============================================================================
--- sandbox/task/boost/task/handle.hpp (original)
+++ sandbox/task/boost/task/handle.hpp 2009-04-20 16:40:47 EDT (Mon, 20 Apr 2009)
@@ -74,12 +74,7 @@
         { return intr_.interruption_requested(); }
 
         R get()
- {
- try
- { return fut_.get(); }
- catch ( broken_promise const&)
- { throw broken_task(); }
- }
+ { return fut_.get(); }
 
         bool is_ready() const
         { return fut_.is_ready(); }
@@ -111,7 +106,7 @@
 class handle< void >
 {
 private:
- template< typename T >
+ template< typename Channel >
         friend class task;
         template< typename Iterator >
         friend void waitfor_all( Iterator begin, Iterator end);
@@ -163,12 +158,7 @@
         { return intr_.interruption_requested(); }
 
         void get()
- {
- try
- { fut_.get(); }
- catch ( broken_promise const&)
- { throw broken_task(); }
- }
+ { fut_.get(); }
 
         bool is_ready() const
         { return fut_.is_ready(); }

Modified: sandbox/task/boost/task/task.hpp
==============================================================================
--- sandbox/task/boost/task/task.hpp (original)
+++ sandbox/task/boost/task/task.hpp 2009-04-20 16:40:47 EDT (Mon, 20 Apr 2009)
@@ -13,16 +13,14 @@
 #include <stdexcept>
 #include <typeinfo>
 
-#include <boost/exception_ptr.hpp>
-#include <boost/exception.hpp>
 #include <boost/preprocessor/repetition.hpp>
 #include <boost/thread.hpp>
 #include <boost/thread/thread_time.hpp>
 #include <boost/utility/result_of.hpp>
 
 #include <boost/task/detail/interrupter.hpp>
-#include <boost/task/exceptions.hpp>
 #include <boost/task/future.hpp>
+#include <boost/task/exceptions.hpp>
 #include <boost/task/handle.hpp>
 
 namespace boost { namespace task
@@ -48,14 +46,12 @@
                 promise< R > prom;
                 shared_future< R > fut;
                 detail::interrupter intr;
- exception_ptr excep;
 
                 impl()
                 :
                 prom(),
                 fut( prom.get_future() ),
- intr(),
- excep()
+ intr()
                 {}
 
                 virtual ~impl() {}
@@ -78,8 +74,6 @@
                 {
                         try
                         { impl::prom.set_value( fn_() ); }
- catch ( promise_already_satisfied const&)
- { impl::excep = copy_exception( task_already_executed() ); }
                         catch ( thread_interrupted const&)
                         { impl::prom.set_exception( copy_exception( task_interrupted() ) ); }
                         catch ( boost::exception const& e)
@@ -156,14 +150,12 @@
                 promise< void > prom;
                 shared_future< void > fut;
                 detail::interrupter intr;
- exception_ptr excep;
 
                 impl()
                 :
                 prom(),
                 fut( prom.get_future() ),
- intr(),
- excep()
+ intr()
                 {}
 
                 virtual ~impl() {}
@@ -189,8 +181,6 @@
                                 fn_();
                                 impl::prom.set_value();
                         }
- catch ( promise_already_satisfied const&)
- { impl::excep = copy_exception( task_already_executed() ); }
                         catch ( thread_interrupted const&)
                         { impl::prom.set_exception( copy_exception( task_interrupted() ) ); }
                         catch ( boost::exception const& e)


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