Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52458 - in sandbox/task: . libs/task/examples
From: oliver.kowalke_at_[hidden]
Date: 2009-04-17 17:51:29


Author: olli
Date: 2009-04-17 17:51:28 EDT (Fri, 17 Apr 2009)
New Revision: 52458
URL: http://svn.boost.org/trac/boost/changeset/52458

Log:
* modified examples

Added:
   sandbox/task/LICENSE_1_0.txt (contents, props changed)
Text files modified:
   sandbox/task/libs/task/examples/reschedule_until.cpp | 12 ++++++------
   sandbox/task/libs/task/examples/submit.cpp | 2 +-
   sandbox/task/libs/task/examples/yield.cpp | 3 +--
   3 files changed, 8 insertions(+), 9 deletions(-)

Added: sandbox/task/LICENSE_1_0.txt
==============================================================================
--- (empty file)
+++ sandbox/task/LICENSE_1_0.txt 2009-04-17 17:51:28 EDT (Fri, 17 Apr 2009)
@@ -0,0 +1,24 @@
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+

Modified: sandbox/task/libs/task/examples/reschedule_until.cpp
==============================================================================
--- sandbox/task/libs/task/examples/reschedule_until.cpp (original)
+++ sandbox/task/libs/task/examples/reschedule_until.cpp 2009-04-17 17:51:28 EDT (Fri, 17 Apr 2009)
@@ -92,7 +92,7 @@
         return n > 0;
 }
 
-void read( int fd)
+void do_read( int fd)
 {
         int nread = 0;
         do
@@ -115,7 +115,7 @@
         while ( nread < 12);
 }
 
-void write( int fd, std::string const& msg)
+void do_write( int fd, std::string const& msg)
 {
         if ( ::write( fd, msg.c_str(), msg.size() ) < 0)
         {
@@ -139,13 +139,13 @@
         {
                 int fd[2];
                 create_sockets( fd);
-
+
                 tsk::launch_in_pool(
                         tsk::make_task(
- & read,
+ & do_read,
                                 fd[0]) );
 
- write( fd[1], "Hello ");
+ do_write( fd[1], "Hello ");
                 boost::this_thread::sleep( pt::seconds( 1) );
 
                 for ( int i = 0; i < 15; ++i)
@@ -154,7 +154,7 @@
                                         & parallel_fib,
                                         i) );
 
- write( fd[1], "World!");
+ do_write( fd[1], "World!");
 
                 return EXIT_SUCCESS;
         }

Modified: sandbox/task/libs/task/examples/submit.cpp
==============================================================================
--- sandbox/task/libs/task/examples/submit.cpp (original)
+++ sandbox/task/libs/task/examples/submit.cpp 2009-04-17 17:51:28 EDT (Fri, 17 Apr 2009)
@@ -49,7 +49,7 @@
                                 10) );
                  tsk::launch_in_pool( t1);
                   tsk::launch_in_thread( t2);
- tsk::launch_local( t3);
+ tsk::launch_in_current( t3);
                 std::cout << t1.get() << std::endl;
                 std::cout << t2.get() << std::endl;
                 std::cout << t3.get() << std::endl;

Modified: sandbox/task/libs/task/examples/yield.cpp
==============================================================================
--- sandbox/task/libs/task/examples/yield.cpp (original)
+++ sandbox/task/libs/task/examples/yield.cpp 2009-04-17 17:51:28 EDT (Fri, 17 Apr 2009)
@@ -84,8 +84,7 @@
         try
         {
                 for ( int i = 0; i < 10; ++i)
- tsk::launch_in_thread(
-// tsk::launch_in_pool(
+ tsk::launch_in_pool(
                                 tsk::make_task(
                                         & parallel_fib,
                                         i) );


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