$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r51776 - in sandbox/threadpool: boost/tp libs/tp/doc libs/tp/examples libs/tp/test
From: oliver.kowalke_at_[hidden]
Date: 2009-03-14 12:07:09
Author: olli
Date: 2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
New Revision: 51776
URL: http://svn.boost.org/trac/boost/changeset/51776
Log:
* reintroduction of future-like interface into task
* task with default ctors
Text files modified: 
   sandbox/threadpool/boost/tp/task.hpp                              |    65 ++++++++++++++++++++++++-----           
   sandbox/threadpool/libs/tp/doc/task.qbk                           |    13 ++++-                                   
   sandbox/threadpool/libs/tp/doc/task_ref.qbk                       |    88 +++++++++++++++++++++++++++++++++++++-- 
   sandbox/threadpool/libs/tp/examples/fork_join.cpp                 |     4                                         
   sandbox/threadpool/libs/tp/examples/interrupt.cpp                 |     2                                         
   sandbox/threadpool/libs/tp/examples/pending.cpp                   |     2                                         
   sandbox/threadpool/libs/tp/examples/reschedule_until.cpp          |     4                                         
   sandbox/threadpool/libs/tp/examples/shutdonw_now.cpp              |     2                                         
   sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp      |     4                                         
   sandbox/threadpool/libs/tp/examples/submit.cpp                    |     2                                         
   sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp       |    16 +++---                                  
   sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp       |    16 +++---                                  
   sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp   |    16 +++---                                  
   sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp      |    16 +++---                                  
   sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp     |    16 +++---                                  
   sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp     |    16 +++---                                  
   sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp |    16 +++---                                  
   sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp    |    16 +++---                                  
   18 files changed, 218 insertions(+), 96 deletions(-)
Modified: sandbox/threadpool/boost/tp/task.hpp
==============================================================================
--- sandbox/threadpool/boost/tp/task.hpp	(original)
+++ sandbox/threadpool/boost/tp/task.hpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -1,4 +1,4 @@
-//  Copyright (c) 2008 Oliver Kowalke. Distributed under the Boost
+//  Copright (c) 2008 Oliver Kowalke. Distributed under the Boost
 //  Software License, Version 1.0. (See accompanying file
 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
@@ -16,8 +16,8 @@
 class task
 {
 private:
-	shared_future< R >	fut_;
-	detail::interrupter			intr_;
+	jss::shared_future< R >	fut_;
+	detail::interrupter		intr_;
 
 public:
         task()
@@ -25,7 +25,7 @@
         {}
 
         task(
-		shared_future< R > const& fut,
+		jss::shared_future< R > const& fut,
                 detail::interrupter const& intr)
         :
         fut_( fut),
@@ -48,20 +48,43 @@
         bool interruption_requested()
         { return intr_.interruption_requested(); }
 
-	shared_future< R > result()
-	{ return fut_; }
+	R get()
+	{ return fut_.get(); }
+
+	bool is_ready() const
+	{ return fut_.is_ready(); }
+
+	bool has_value() const
+	{ return fut_.has_value(); }
+
+	bool has_exception() const
+	{ return fut_.has_exception(); }
+
+	void wait() const
+	{ fut_.wait(); }
+
+    template< typename Duration >
+    bool timed_wait( Duration const& rel_time) const
+	{ return fut_.timed_wait( rel_time); }
+
+    bool timed_wait_until( system_time const& abs_time) const
+	{ return fut_.timed_wait_until( abs_time); }
 };
 
 template<>
 class task< void >
 {
 private:
-	shared_future< void >	fut_;
-	detail::interrupter				intr_;
+	jss::shared_future< void >	fut_;
+	detail::interrupter			intr_;
 
 public:
+	task()
+	: fut_(), intr_()
+	{}
+
         task(
-		shared_future< void > const& fut,
+		jss::shared_future< void > const& fut,
                 detail::interrupter const& intr)
         :
         fut_( fut),
@@ -84,10 +107,28 @@
         bool interruption_requested()
         { return intr_.interruption_requested(); }
 
-	shared_future< void > result()
-	{ return fut_; }
-};
+	void get()
+	{ fut_.get(); }
+
+	bool is_ready() const
+	{ return fut_.is_ready(); }
+
+	bool has_value() const
+	{ return fut_.has_value(); }
 
+	bool has_exception() const
+	{ return fut_.has_exception(); }
+
+	void wait() const
+	{ fut_.wait(); }
+
+    template< typename Duration >
+    bool timed_wait( Duration const& rel_time) const
+	{ return fut_.timed_wait( rel_time); }
+
+    bool timed_wait_until( system_time const& abs_time) const
+	{ return fut_.timed_wait_until( abs_time); }
+};
 } }
 
 #endif // BOOST_TP_TASK_H
Modified: sandbox/threadpool/libs/tp/doc/task.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/task.qbk	(original)
+++ sandbox/threadpool/libs/tp/doc/task.qbk	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -21,7 +21,7 @@
       fibonacci_fn,
       10) ) );
 
-    std::cout << t.result().get() << std::endl; // 55
+    std::cout << t.get() << std::endl; // 55
 
 
 [heading Interruption]
@@ -57,7 +57,7 @@
     t.interrupt();
 
     // throws boost::thread_interrupted exception
-    std::cout << t.result().get() << std::endl;
+    std::cout << t.get() << std::endl;
 ``
 
     boost::tp::pool<
@@ -74,7 +74,11 @@
     t.interrupt_and_wait();
 
     // throws boost::thread_interrupted exception
-    std::cout << t.result().get() << std::endl;
+    std::cout << t.get() << std::endl;
+
+[heading Waiting for multiple tasks]
+It is possible to wait for multiple tasks - `boost::tp::wait_for_all(tsk1,...,tskn)` blocks until all n tasks are ready and
+`boost::tp::wait_for_any(tsk1,...,tskn)` blocks until at least one of the tasks becomes ready.
 
 [heading Exceptions in tasks]
 Exceptions thrown inside an __action__ are transported by the associated task object.
@@ -97,6 +101,7 @@
 *  `boost::broken_promise`
 *  `boost::future_already_set`
 *  `boost::future_cancel`
+*  `boost::exception`
 *  `boost::invalid_thread_argument`
 *  `boost::lock_error`
 *  `boost::thread_exception`
@@ -117,6 +122,6 @@
         boost::bind(
           throwing_fn) ) );
 
-    std::cout << t.result().get() << std::endl; // will rethrow an std::runtime_error
+    std::cout << t.get() << std::endl; // will rethrow an std::runtime_error
 
 [endsect]
Modified: sandbox/threadpool/libs/tp/doc/task_ref.qbk
==============================================================================
--- sandbox/threadpool/libs/tp/doc/task_ref.qbk	(original)
+++ sandbox/threadpool/libs/tp/doc/task_ref.qbk	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -16,7 +16,7 @@
       template< typename Pool >
       task(
         Pool * pool,
-        shared_future< R > const& fut,
+        future< R > const& fut,
         detail::interrupter const& intr);
 
       void interrupt();
@@ -26,7 +26,16 @@
       void interrupt_and_wait( Duration const& rel_time);
       bool interrupt_requested();
 
-      shared_future< R > result() const;
+      R get() const;
+
+      bool is_ready() const;
+      bool has_value() const;
+      bool has_exception() const;
+
+      void wait() const; 
+      template< typename Duration >
+      bool timed_wait( Duration const& rel_time) const;
+      bool timed_wait_until( system_time const& abs_time) const; 
     };
 
 [section:constructor Constructor]
@@ -34,7 +43,7 @@
     template< typename Pool >
     task(
       Pool * pool,
-      shared_future< R > const& fut,
+      future< R > const& fut,
       detail::interrupter const& intr);
 
 [variablelist
@@ -72,15 +81,82 @@
 [endsect]
 
 
-[section:result Member function `result()`]
+[section:get Member function `get()`]
 
-    shared_future< R > result() const;
+    R get() const;
 
 [variablelist
-[[Effects:] [Returns fulfilled value or throws fulfilled exception via a shared_future.]]
+[[Effects:] [Returns fulfilled value or throws fulfilled exception.]]
 [[Throws:] [`boost::future::broken_promise`]]
 ]
 [endsect]
 
 
+[section:is_read Member function `is_ready()`]
+
+    bool is_ready() const;
+
+[variablelist
+[[Effects:] [Queries if the __action__ has been fulfilled.]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:has_value Member function `has_value()`]
+
+    bool has_value() const;
+
+[variablelist
+[[Effects:] [Queries if the __action__ has been fulfilled (is ready) and has a value.]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:has_exception Member function `has_exception()`]
+
+    bool has_exception() const;
+
+[variablelist
+[[Effects:] [Queries if the __action__ has been fulfilled (is ready) and has an exception.]]
+[[Throws:] [Nothing]]
+]
+[endsect]
+
+
+[section:wait Member function `wait()`]
+
+    void wait() const;
+
+[variablelist
+[[Effects:] [Waits until the result is ready.]]
+[[Throws:] [Throws thread_interrupted if the result is not ready at the point of the call, and the current thread is interrupted.]]
+]
+[endsect]
+
+
+[section:timed_wait Member function `timed_wait()`]
+
+    template< typename Duration >
+    bool timed_wait( Duration const& wait_duration);
+
+[variablelist
+[[Effects:] [Waits until the result is ready, or returns false if the time specified by wait_duration has elapsed.]]
+[[Throws:] [Throws thread_interrupted if the result is not ready at the point of the call, and the current thread is interrupted.]]
+]
+[endsect]
+
+
+[section:timed_wait_until Member function `timed_wait_until()`]
+
+    bool timed_wait_until( system_time const& wait_timeout);
+
+[variablelist
+[[Effects:] [Waits until the result is ready, or returns false if the time point specified by wait_timeout has passed.]]
+[[Throws:] [Throws thread_interrupted if the result is not ready at the point of the call, and the current thread is interrupted.]]
+]
+[endsect]
+
+
 [endsect]
Modified: sandbox/threadpool/libs/tp/examples/fork_join.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/fork_join.cpp	(original)
+++ sandbox/threadpool/libs/tp/examples/fork_join.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -44,7 +44,7 @@
                                                 & fibo::par_,
                                                 boost::ref( * this),
                                                 n - 2) ) );
-			return t1.result().get() + t2.result().get();
+			return t1.get() + t2.get();
                 }
         }
 
@@ -85,7 +85,7 @@
                         std::vector< tp::task< int > >::iterator i( results.begin() );
                         i != e;
                         ++i)
-			std::cout << "fibonacci " << k++ << " == " << i->result().get() << std::endl;
+			std::cout << "fibonacci " << k++ << " == " << i->get() << std::endl;
 
                 pt::ptime stop( pt::microsec_clock::universal_time() );
                 std::cout << ( stop - start).total_milliseconds() << " milli seconds" << std::endl;
Modified: sandbox/threadpool/libs/tp/examples/interrupt.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/interrupt.cpp	(original)
+++ sandbox/threadpool/libs/tp/examples/interrupt.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -54,7 +54,7 @@
                                         fibonacci_fn,
                                         10) ) );
                 t.interrupt();
-		std::cout << t.result().get() << std::endl;
+		std::cout << t.get() << std::endl;
 
                 return EXIT_SUCCESS;
         }
Modified: sandbox/threadpool/libs/tp/examples/pending.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/pending.cpp	(original)
+++ sandbox/threadpool/libs/tp/examples/pending.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -52,7 +52,7 @@
                                         fibonacci_fn,
                                         10) ) );
                 std::cout << "pending tasks == " << pool.pending() << std::endl;
-		std::cout << t.result().get() << std::endl;
+		std::cout << t.get() << std::endl;
 
                 return EXIT_SUCCESS;
         }
Modified: sandbox/threadpool/libs/tp/examples/reschedule_until.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/reschedule_until.cpp	(original)
+++ sandbox/threadpool/libs/tp/examples/reschedule_until.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -70,7 +70,7 @@
                                 boost::this_task::get_thread_pool< pool_type >().submit(
                                         fn2) );
 
-			return t1.result().get() + t2.result().get();
+			return t1.get() + t2.get();
                 }
         }
 
@@ -120,7 +120,7 @@
                         std::vector< tp::task< int > >::iterator i( results.begin() );
                         i != e;
                         ++i)
-			std::cout << "fibonacci " << k++ << " == " << i->result().get() << std::endl;
+			std::cout << "fibonacci " << k++ << " == " << i->get() << std::endl;
 
                 pt::ptime stop( pt::microsec_clock::universal_time() );
                 std::cout << ( stop - start).total_milliseconds() << " milli seconds" << std::endl;
Modified: sandbox/threadpool/libs/tp/examples/shutdonw_now.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/shutdonw_now.cpp	(original)
+++ sandbox/threadpool/libs/tp/examples/shutdonw_now.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -47,7 +47,7 @@
                                         10) ) );
                 boost::this_thread::sleep( pt::milliseconds( 250) );
                 pool.shutdown_now();
-		std::cout << t.result().get() << std::endl;
+		std::cout << t.get() << std::endl;
 
                 return EXIT_SUCCESS;
         }
Modified: sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp	(original)
+++ sandbox/threadpool/libs/tp/examples/spread_over_hardware.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -44,7 +44,7 @@
                                                 & fibo::par_,
                                                 boost::ref( * this),
                                                 n - 2) ) );
-			return t1.result().get() + t2.result().get();
+			return t1.get() + t2.get();
                 }
         }
 
@@ -86,7 +86,7 @@
                         std::vector< tp::task< int > >::iterator i( results.begin() );
                         i != e;
                         ++i)
-			std::cout << "fibonacci " << k++ << " == " << i->result().get() << std::endl;
+			std::cout << "fibonacci " << k++ << " == " << i->get() << std::endl;
 
                 pt::ptime stop( pt::microsec_clock::universal_time() );
                 std::cout << ( stop - start).total_milliseconds() << " milli seconds" << std::endl;
Modified: sandbox/threadpool/libs/tp/examples/submit.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/examples/submit.cpp	(original)
+++ sandbox/threadpool/libs/tp/examples/submit.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -40,7 +40,7 @@
                                 boost::bind(
                                         fibonacci_fn,
                                         10) ) );
-		std::cout << t.result().get() << std::endl;
+		std::cout << t.get() << std::endl;
 
                 return EXIT_SUCCESS;
         }
Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp	(original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_fifo.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -62,7 +62,7 @@
                                 boost::bind(
                                         fibonacci_fn,
                                         10) ) );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check shutdown
@@ -81,7 +81,7 @@
                                         10) ) );
                 pool.shutdown();
                 BOOST_CHECK( pool.terminated() );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check runtime_error throw inside task
@@ -100,7 +100,7 @@
                 pool.shutdown();
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -158,7 +158,7 @@
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -194,9 +194,9 @@
                 boost::this_thread::sleep( pt::millisec(250) );
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 2) );
                 b.wait();
-		BOOST_CHECK_EQUAL( t1.result().get(), 55);
-		BOOST_CHECK_EQUAL( t2.result().get(), 55);
-		BOOST_CHECK_EQUAL( t3.result().get(), 55);
+		BOOST_CHECK_EQUAL( t1.get(), 55);
+		BOOST_CHECK_EQUAL( t2.get(), 55);
+		BOOST_CHECK_EQUAL( t3.get(), 55);
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 0) );
         }
 
@@ -277,7 +277,7 @@
                 BOOST_CHECK_EQUAL( buffer.size(), std::size_t( 1) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp	(original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_lifo.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -62,7 +62,7 @@
                                 boost::bind(
                                         fibonacci_fn,
                                         10) ) );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check shutdown
@@ -81,7 +81,7 @@
                                         10) ) );
                 pool.shutdown();
                 BOOST_CHECK( pool.terminated() );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check runtime_error throw inside task
@@ -100,7 +100,7 @@
                 pool.shutdown();
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -158,7 +158,7 @@
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -194,9 +194,9 @@
                 boost::this_thread::sleep( pt::millisec(250) );
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 2) );
                 b.wait();
-		BOOST_CHECK_EQUAL( t1.result().get(), 55);
-		BOOST_CHECK_EQUAL( t2.result().get(), 55);
-		BOOST_CHECK_EQUAL( t3.result().get(), 55);
+		BOOST_CHECK_EQUAL( t1.get(), 55);
+		BOOST_CHECK_EQUAL( t2.get(), 55);
+		BOOST_CHECK_EQUAL( t3.get(), 55);
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 0) );
         }
 
@@ -277,7 +277,7 @@
                 BOOST_CHECK_EQUAL( buffer.size(), std::size_t( 1) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp	(original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_priority.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -63,7 +63,7 @@
                                         fibonacci_fn,
                                         10),
                         0) );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check shutdown
@@ -83,7 +83,7 @@
                                 0) );
                 pool.shutdown();
                 BOOST_CHECK( pool.terminated() );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check runtime_error throw inside task
@@ -103,7 +103,7 @@
                 pool.shutdown();
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -165,7 +165,7 @@
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -202,9 +202,9 @@
                 boost::this_thread::sleep( pt::millisec(250) );
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 2) );
                 b.wait();
-		BOOST_CHECK_EQUAL( t1.result().get(), 55);
-		BOOST_CHECK_EQUAL( t2.result().get(), 55);
-		BOOST_CHECK_EQUAL( t3.result().get(), 55);
+		BOOST_CHECK_EQUAL( t1.get(), 55);
+		BOOST_CHECK_EQUAL( t2.get(), 55);
+		BOOST_CHECK_EQUAL( t3.get(), 55);
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 0) );
         }
 
@@ -291,7 +291,7 @@
                 BOOST_CHECK_EQUAL( buffer.size(), std::size_t( 1) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
Modified: sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp	(original)
+++ sandbox/threadpool/libs/tp/test/test_bounded_queue_smart.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -63,7 +63,7 @@
                                         fibonacci_fn,
                                         10),
                         0) );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check shutdown
@@ -83,7 +83,7 @@
                                 0) );
                 pool.shutdown();
                 BOOST_CHECK( pool.terminated() );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check runtime_error throw inside task
@@ -103,7 +103,7 @@
                 pool.shutdown();
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -165,7 +165,7 @@
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -202,9 +202,9 @@
                 boost::this_thread::sleep( pt::millisec(250) );
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 2) );
                 b.wait();
-		BOOST_CHECK_EQUAL( t1.result().get(), 55);
-		BOOST_CHECK_EQUAL( t2.result().get(), 55);
-		BOOST_CHECK_EQUAL( t3.result().get(), 55);
+		BOOST_CHECK_EQUAL( t1.get(), 55);
+		BOOST_CHECK_EQUAL( t2.get(), 55);
+		BOOST_CHECK_EQUAL( t3.get(), 55);
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 0) );
         }
 
@@ -297,7 +297,7 @@
                 BOOST_CHECK_EQUAL( buffer.size(), std::size_t( 1) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp	(original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_fifo.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -55,7 +55,7 @@
                                 boost::bind(
                                         fibonacci_fn,
                                         10) ) );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check shutdown
@@ -71,7 +71,7 @@
                                         10) ) );
                 pool.shutdown();
                 BOOST_CHECK( pool.terminated() );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check runtime_error throw inside task
@@ -87,7 +87,7 @@
                 pool.shutdown();
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -139,7 +139,7 @@
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -172,9 +172,9 @@
                 boost::this_thread::sleep( pt::millisec(250) );
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 2) );
                 b.wait();
-		BOOST_CHECK_EQUAL( t1.result().get(), 55);
-		BOOST_CHECK_EQUAL( t2.result().get(), 55);
-		BOOST_CHECK_EQUAL( t3.result().get(), 55);
+		BOOST_CHECK_EQUAL( t1.get(), 55);
+		BOOST_CHECK_EQUAL( t2.get(), 55);
+		BOOST_CHECK_EQUAL( t3.get(), 55);
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 0) );
         }
 
@@ -249,7 +249,7 @@
                 BOOST_CHECK_EQUAL( buffer.size(), std::size_t( 1) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp	(original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_lifo.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -55,7 +55,7 @@
                                 boost::bind(
                                         fibonacci_fn,
                                         10) ) );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check shutdown
@@ -71,7 +71,7 @@
                                         10) ) );
                 pool.shutdown();
                 BOOST_CHECK( pool.terminated() );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check runtime_error throw inside task
@@ -87,7 +87,7 @@
                 pool.shutdown();
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -139,7 +139,7 @@
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -172,9 +172,9 @@
                 boost::this_thread::sleep( pt::millisec(250) );
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 2) );
                 b.wait();
-		BOOST_CHECK_EQUAL( t1.result().get(), 55);
-		BOOST_CHECK_EQUAL( t2.result().get(), 55);
-		BOOST_CHECK_EQUAL( t3.result().get(), 55);
+		BOOST_CHECK_EQUAL( t1.get(), 55);
+		BOOST_CHECK_EQUAL( t2.get(), 55);
+		BOOST_CHECK_EQUAL( t3.get(), 55);
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 0) );
         }
 
@@ -249,7 +249,7 @@
                 BOOST_CHECK_EQUAL( buffer.size(), std::size_t( 1) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp	(original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_priority.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -56,7 +56,7 @@
                                         fibonacci_fn,
                                         10),
                         0) );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check shutdown
@@ -73,7 +73,7 @@
                                 0) );
                 pool.shutdown();
                 BOOST_CHECK( pool.terminated() );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check runtime_error throw inside task
@@ -90,7 +90,7 @@
                 pool.shutdown();
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -146,7 +146,7 @@
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -180,9 +180,9 @@
                 boost::this_thread::sleep( pt::millisec(250) );
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 2) );
                 b.wait();
-		BOOST_CHECK_EQUAL( t1.result().get(), 55);
-		BOOST_CHECK_EQUAL( t2.result().get(), 55);
-		BOOST_CHECK_EQUAL( t3.result().get(), 55);
+		BOOST_CHECK_EQUAL( t1.get(), 55);
+		BOOST_CHECK_EQUAL( t2.get(), 55);
+		BOOST_CHECK_EQUAL( t3.get(), 55);
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 0) );
         }
 
@@ -263,7 +263,7 @@
                 BOOST_CHECK_EQUAL( buffer.size(), std::size_t( 1) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
Modified: sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp
==============================================================================
--- sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp	(original)
+++ sandbox/threadpool/libs/tp/test/test_unbounded_queue_smart.cpp	2009-03-14 12:07:06 EDT (Sat, 14 Mar 2009)
@@ -56,7 +56,7 @@
                                         fibonacci_fn,
                                         10),
                         0) );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check shutdown
@@ -73,7 +73,7 @@
                                 0) );
                 pool.shutdown();
                 BOOST_CHECK( pool.terminated() );
-		BOOST_CHECK_EQUAL( t.result().get(), 55);
+		BOOST_CHECK_EQUAL( t.get(), 55);
         }
 
         // check runtime_error throw inside task
@@ -90,7 +90,7 @@
                 pool.shutdown();
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( std::runtime_error const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -146,7 +146,7 @@
                 BOOST_CHECK_EQUAL( pool.active(), std::size_t( 0) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);
@@ -180,9 +180,9 @@
                 boost::this_thread::sleep( pt::millisec(250) );
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 2) );
                 b.wait();
-		BOOST_CHECK_EQUAL( t1.result().get(), 55);
-		BOOST_CHECK_EQUAL( t2.result().get(), 55);
-		BOOST_CHECK_EQUAL( t3.result().get(), 55);
+		BOOST_CHECK_EQUAL( t1.get(), 55);
+		BOOST_CHECK_EQUAL( t2.get(), 55);
+		BOOST_CHECK_EQUAL( t3.get(), 55);
                 BOOST_CHECK_EQUAL( pool.pending(), std::size_t( 0) );
         }
 
@@ -269,7 +269,7 @@
                 BOOST_CHECK_EQUAL( buffer.size(), std::size_t( 1) );
                 bool thrown( false);
                 try
-		{ t.result().get(); }
+		{ t.get(); }
                 catch ( boost::thread_interrupted const&)
                 { thrown = true; }
                 BOOST_CHECK( thrown);