From baabddae440dbf15d1c8a31a46ef843ef7c95964 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Wed, 5 Feb 2014 17:38:09 +0100 Subject: [PATCH] rename symmetric_coroutine_self -> symmetric_coroutine_yield --- doc/coro.qbk | 6 +- doc/intro.qbk | 2 +- doc/motivation.qbk | 8 +- doc/symmetric.qbk | 66 ++++++------- example/cpp03/symmetric/dice_game.cpp | 4 +- example/cpp03/symmetric/merge_arrays.cpp | 4 +- example/cpp03/symmetric/simple.cpp | 12 +-- example/cpp11/symmetric/merge_arrays.cpp | 8 +- example/cpp11/symmetric/simple.cpp | 12 +-- ...self.hpp => symmetric_coroutine_yield.hpp} | 74 +++++++-------- include/boost/coroutine/detail/trampoline.hpp | 12 +-- .../coroutine/detail/trampoline_pull.hpp | 8 +- .../coroutine/detail/trampoline_push.hpp | 8 +- .../boost/coroutine/symmetric_coroutine.hpp | 68 +++++++------- performance/bind_processor_aix.cpp | 2 +- performance/bind_processor_linux.cpp | 2 +- .../symmetric/performance_create_prealloc.cpp | 2 +- .../performance_create_protected.cpp | 2 +- .../symmetric/performance_create_standard.cpp | 2 +- performance/symmetric/performance_switch.cpp | 6 +- .../performance_create_segmented.cpp | 2 +- test/test_symmetric_coroutine.cpp | 92 +++++++++---------- 22 files changed, 201 insertions(+), 201 deletions(-) rename include/boost/coroutine/detail/{symmetric_coroutine_self.hpp => symmetric_coroutine_yield.hpp} (63%) diff --git a/doc/coro.qbk b/doc/coro.qbk index 4a8a9b1..e432077 100644 --- a/doc/coro.qbk +++ b/doc/coro.qbk @@ -48,7 +48,7 @@ [def __push_coro__ ['asymmetric_coroutine<>::push_type]] [def __scoro__ ['symmetric_coroutine<>]] [def __segmented_stack__ ['segemented-stack]] -[def __self_scoro__ ['symmetric_coroutine<>::self_type]] +[def __yield_scoro__ ['symmetric_coroutine<>::yield_type]] [def __signature__ ['Signature]] [def __stack_allocator_concept__ ['stack-allocator concept]] [def __stack_allocator__ ['stack-allocator]] @@ -78,8 +78,8 @@ [def __scoro_bool__ ['boost::coroutines::symmetric_coroutine<>::operator bool]] [def __scoro_op__ ['boost::coroutines::symmetric_coroutine<>::operator()]] [def __segmented_allocator__ ['boost::coroutines::segmented_stack_allocator]] -[def __self_scoro_get__ ['boost::coroutines::symmetric_coroutine<>::self_type::get()]] -[def __self_scoro_op__ ['boost::coroutines::symmetric_coroutine<>::self_type::operator()]] +[def __yield_scoro_get__ ['boost::coroutines::symmetric_coroutine<>::yield_type::get()]] +[def __yield_scoro_op__ ['boost::coroutines::symmetric_coroutine<>::yield_type::operator()]] [def __server__ ['server]] [def __session__ ['session]] [def __stack_context__ ['boost::coroutines::stack_context]] diff --git a/doc/intro.qbk b/doc/intro.qbk index fc93817..8bb595b 100644 --- a/doc/intro.qbk +++ b/doc/intro.qbk @@ -91,7 +91,7 @@ In contrast to a stackless coroutine a stackful coroutine allows to suspend from nested stackframes. The execution resumes at exact the same point in the code as it was suspended before. With a stackless coroutine, only the top-level routine may be suspended. Any -routine called by that top-level routine may not itself suspend. This prohibits +routine called by that top-level routine may not ityield suspend. This prohibits providing suspend/resume operations in routines within a general-purpose library. [heading first-class continuation] diff --git a/doc/motivation.qbk b/doc/motivation.qbk index 0c5da94..78f55cc 100644 --- a/doc/motivation.qbk +++ b/doc/motivation.qbk @@ -168,11 +168,11 @@ This example demonstrates how symmetric coroutines merge two sorted arrays. boost::coroutines::symmetric_coroutine< void > * other_a = 0, * other_b = 0; boost::coroutines::symmetric_coroutine< void > coro_a( - [&]( boost::coroutines::symmetric_coroutine< void >::self_type & self) { + [&]( boost::coroutines::symmetric_coroutine< void >::yield_type & yield) { while ( idx_a < a.size() ) { if ( b[idx_b] < a[idx_a]) - self( * other_b); + yield( * other_b); c.push_back(a[idx_a++]); } while ( c.size() < a.size() + b.size()) @@ -180,11 +180,11 @@ This example demonstrates how symmetric coroutines merge two sorted arrays. }); boost::coroutines::symmetric_coroutine< void > coro_b( - [&]( boost::coroutines::symmetric_coroutine< void >::self_type & self) { + [&]( boost::coroutines::symmetric_coroutine< void >::yield_type & yield) { while ( idx_b < b.size() ) { if ( a[idx_a] < b[idx_b]) - self( * other_a); + yield( * other_a); c.push_back(b[idx_b++]); } while ( c.size() < ( a.size() + b.size() ) ) diff --git a/doc/symmetric.qbk b/doc/symmetric.qbk index 00e8f82..6012ecc 100644 --- a/doc/symmetric.qbk +++ b/doc/symmetric.qbk @@ -17,26 +17,26 @@ to return to its caller. __scoro__ starts a symmetric coroutine and transfers parameter to its __coro_fn__. The first template parameter defining the transferred parameter type. The constructor of __scoro__ takes a function (__coro_fn__) accepting a -reference to a __self_scoro__ as argument. Instantiating a __scoro__ does +reference to a __yield_scoro__ as argument. Instantiating a __scoro__ does not pass the control of execution to __coro_fn__ - instead the first call of -__scoro_op__ synthesizes a __self_scoro__ passed it as reference to __coro_fn__. +__scoro_op__ synthesizes a __yield_scoro__ passed it as reference to __coro_fn__. The interface does not contain a ['get()]-function: you can not retrieve values from another execution context with this kind of coroutine. -[heading __self_scoro__] -__self_scoro_op__ ist used to transfers data to another execution context - +[heading __yield_scoro__] +__yield_scoro_op__ ist used to transfers data to another execution context - which might be a __scoro__ or called with no argument back to the excecution context were the chain of symmetric coroutines has been started (invocation of __scoro_op__). The class has only one template parameter defining the transferred parameter type. -Data transferred to the coroutine are accessed through __self_scoro_get__. +Data transferred to the coroutine are accessed through __yield_scoro_get__. [heading coroutine-function] -The __coro_fn__ returns ['void] and takes __self_scoro__, providing +The __coro_fn__ returns ['void] and takes __yield_scoro__, providing coroutine functionality inside the coroutine-fn, as argument, so that using this instance passed as argument to __coro_fn__ is the only way to transfer data and execution control. @@ -58,18 +58,18 @@ data value is given by __pull_coro_get__. [heading passing data from main-context to a symmetric-coroutine] In order to transfer data to a __scoro__ from the main-context the framework -synthesizes a __self_scoro__ associated with the __scoro__ instance in the -main-context. The synthesized __self_scoro__ is passed as argument to +synthesizes a __yield_scoro__ associated with the __scoro__ instance in the +main-context. The synthesized __yield_scoro__ is passed as argument to __coro_fn__. The main-context must call __scoro_op__ in order to transfer each data value into the __coro_fn__. -Access to the transferred data value is given by __self_scoro_get__. +Access to the transferred data value is given by __yield_scoro_get__. boost::coroutines::symmetric_coroutine coro( // constructor does NOT enter coroutine-function - [&](boost::coroutines::symmetric_coroutine::self_type& self){ + [&](boost::coroutines::symmetric_coroutine::yield_type& yield){ for (;;) { - std::cout << self.get() << " "; - self(); // jump back to starting context + std::cout << yield.get() << " "; + yield(); // jump back to starting context } }); @@ -128,11 +128,11 @@ After unwinding, a __coro__ is complete. { boost::coroutines::symmetric_coroutine coro( - [&](boost::coroutines::symmetric_coroutine::self_type& self){ + [&](boost::coroutines::symmetric_coroutine::yield_type& yield){ X x; std::cout<<"fn()"<::self_type`] +[section:yield_coro Class `symmetric_coroutine<>::yield_type`] #include template< typename R, typename StackAllocator = standard_stack_allocator > - class symmetric_coroutine<>::self_type + class symmetric_coroutine<>::yield_type { public: - self_type( self_type const& other)=delete; + yield_type( yield_type const& other)=delete; - self_type & operator=( self_type const& other)=delete; + yield_type & operator=( yield_type const& other)=delete; - self_type( self_type && other) noexcept; + yield_type( yield_type && other) noexcept; - self_type & operator=( self_type && other) noexcept; + yield_type & operator=( yield_type && other) noexcept; - void swap( self_type & other) noexcept; + void swap( yield_type & other) noexcept; - self_type & operator()(); + yield_type & operator()(); template< typename X > - self_type & operator()( symmetric_coroutine< X > & other, X & x); + yield_type & operator()( symmetric_coroutine< X > & other, X & x); template< typename X > - self_type & operator()( symmetric_coroutine< X > & other); + yield_type & operator()( symmetric_coroutine< X > & other); R get() const noexcept; }; template< typename R > - void swap( symmetric_coroutine< R >::self_type & l, symmetric_coroutine< R >::self_type & r); + void swap( symmetric_coroutine< R >::yield_type & l, symmetric_coroutine< R >::yield_type & r); -[heading `self_type( self_type && other)`] +[heading `yield_type( yield_type && other)`] [variablelist [[Effects:] [Moves the internal data of `other` to `*this`. `other` becomes __not_a_coro__.]] [[Throws:] [Nothing.]] ] -[heading `self_type & operator=( self_type && other)`] +[heading `yield_type & operator=( yield_type && other)`] [variablelist [[Effects:] [Destroys the internal data of `*this` and moves the internal data of `other` to `*this`. `other` becomes __not_a_coro__.]] @@ -221,7 +221,7 @@ Otherwise false.]] [[Throws:] [Nothing.]] ] -[heading `self_type & operator()()`] +[heading `yield_type & operator()()`] [variablelist [[Preconditions:] [`*this` is not a __not_a_coro__.]] [[Effects:] [Execution control is transferred to __coro_fn__ (no parameter are @@ -231,9 +231,9 @@ passed to the coroutine-function).]] [heading `R get()()`] - R symmetric_oroutine::self_type::get(); - R& symmetric_oroutine::self_type::get(); - void symmetric_oroutineself_type::get()=delete; + R symmetric_oroutine::yield_type::get(); + R& symmetric_oroutine::yield_type::get(); + void symmetric_oroutineyield_type::get()=delete; [variablelist [[Preconditions:] [`*this` is not a __not_a_coro__.]] @@ -242,7 +242,7 @@ __push_coro_op__.]] [[Throws:] [Nothing.]] ] -[heading `void swap( self_type & other)`] +[heading `void swap( yield_type & other)`] [variablelist [[Effects:] [Swaps the internal data from `*this` with the values of `other`.]] @@ -252,7 +252,7 @@ of `other`.]] [heading Non-member function `swap()`] template< typename R > - void swap( symmetric_coroutine< R >::self_type & l, symmetric_coroutine< R >::self_type & r); + void swap( symmetric_coroutine< R >::yield_type & l, symmetric_coroutine< R >::yield_type & r); [variablelist [[Effects:] [As if 'l.swap( r)'.]] diff --git a/example/cpp03/symmetric/dice_game.cpp b/example/cpp03/symmetric/dice_game.cpp index 56da967..90de50c 100644 --- a/example/cpp03/symmetric/dice_game.cpp +++ b/example/cpp03/symmetric/dice_game.cpp @@ -24,11 +24,11 @@ private: return dist( gen); } - void run_( coro_t::self_type & self) + void run_( coro_t::yield_type & yield) { int sum = 0; while ( ( sum += die() ) < 100) - self( nxt->coro); + yield( nxt->coro); std::cout << "player " << id << " winns" << std::endl; } diff --git a/example/cpp03/symmetric/merge_arrays.cpp b/example/cpp03/symmetric/merge_arrays.cpp index 095fc87..78c983e 100644 --- a/example/cpp03/symmetric/merge_arrays.cpp +++ b/example/cpp03/symmetric/merge_arrays.cpp @@ -21,12 +21,12 @@ private: std::size_t max_; std::vector< int > & to_; - void run_( coro_t::self_type & self) + void run_( coro_t::yield_type & yield) { while ( idx < from.size() ) { if ( other->from[other->idx] < from[idx]) - self( other->coro); + yield( other->coro); to_.push_back(from[idx++]); } while ( to_.size() < max_) diff --git a/example/cpp03/symmetric/simple.cpp b/example/cpp03/symmetric/simple.cpp index a071b52..e9e78b2 100644 --- a/example/cpp03/symmetric/simple.cpp +++ b/example/cpp03/symmetric/simple.cpp @@ -15,21 +15,21 @@ typedef boost::coroutines::symmetric_coroutine< void > coro_t; coro_t * c1 = 0; coro_t * c2 = 0; -void foo( coro_t::self_type & self) +void foo( coro_t::yield_type & yield) { std::cout << "foo1" << std::endl; - self( * c2); + yield( * c2); std::cout << "foo2" << std::endl; - self( * c2); + yield( * c2); std::cout << "foo3" << std::endl; } -void bar( coro_t::self_type & self) +void bar( coro_t::yield_type & yield) { std::cout << "bar1" << std::endl; - self( * c1); + yield( * c1); std::cout << "bar2" << std::endl; - self( * c1); + yield( * c1); std::cout << "bar3" << std::endl; } diff --git a/example/cpp11/symmetric/merge_arrays.cpp b/example/cpp11/symmetric/merge_arrays.cpp index a586ec8..df50f6b 100644 --- a/example/cpp11/symmetric/merge_arrays.cpp +++ b/example/cpp11/symmetric/merge_arrays.cpp @@ -20,11 +20,11 @@ std::vector< int > merge( std::vector< int > const& a, std::vector< int > const& coro_t * other_a = 0, * other_b = 0; coro_t coro_a( - [&]( coro_t::self_type & self) { + [&]( coro_t::yield_type & yield) { while ( idx_a < a.size() ) { if ( b[idx_b] < a[idx_a]) - self( * other_b); + yield( * other_b); c.push_back(a[idx_a++]); } while ( c.size() < a.size() + b.size()) @@ -32,11 +32,11 @@ std::vector< int > merge( std::vector< int > const& a, std::vector< int > const& }); coro_t coro_b( - [&]( coro_t::self_type & self) { + [&]( coro_t::yield_type & yield) { while ( idx_b < b.size() ) { if ( a[idx_a] < b[idx_b]) - self( * other_a); + yield( * other_a); c.push_back(b[idx_b++]); } while ( c.size() < ( a.size() + b.size() ) ) diff --git a/example/cpp11/symmetric/simple.cpp b/example/cpp11/symmetric/simple.cpp index 4386e39..098f69b 100644 --- a/example/cpp11/symmetric/simple.cpp +++ b/example/cpp11/symmetric/simple.cpp @@ -17,19 +17,19 @@ int main( int argc, char * argv[]) coro_t * other2 = 0; coro_t coro1( - [&]( coro_t::self_type & self) { + [&]( coro_t::yield_type & yield) { std::cout << "foo1" << std::endl; - self( * other2); + yield( * other2); std::cout << "foo2" << std::endl; - self( * other2); + yield( * other2); std::cout << "foo3" << std::endl; }); coro_t coro2( - [&]( coro_t::self_type & self) { + [&]( coro_t::yield_type & yield) { std::cout << "bar1" << std::endl; - self( * other1); + yield( * other1); std::cout << "bar2" << std::endl; - self( * other1); + yield( * other1); std::cout << "bar3" << std::endl; }); diff --git a/include/boost/coroutine/detail/symmetric_coroutine_self.hpp b/include/boost/coroutine/detail/symmetric_coroutine_yield.hpp similarity index 63% rename from include/boost/coroutine/detail/symmetric_coroutine_self.hpp rename to include/boost/coroutine/detail/symmetric_coroutine_yield.hpp index f33fbec..621ded2 100644 --- a/include/boost/coroutine/detail/symmetric_coroutine_self.hpp +++ b/include/boost/coroutine/detail/symmetric_coroutine_yield.hpp @@ -4,8 +4,8 @@ // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_COROUTINES_DETAIL_SYMMETRIC_COROUTINE_SELF_H -#define BOOST_COROUTINES_DETAIL_SYMMETRIC_COROUTINE_SELF_H +#ifndef BOOST_COROUTINES_DETAIL_SYMMETRIC_COROUTINE_YIELD_H +#define BOOST_COROUTINES_DETAIL_SYMMETRIC_COROUTINE_YIELD_H #include @@ -29,7 +29,7 @@ namespace coroutines { namespace detail { template< typename R > -class symmetric_coroutine_self +class symmetric_coroutine_yield { private: template< typename X, typename Y, typename Z > @@ -38,12 +38,12 @@ private: typedef parameters< R > param_type; typedef symmetric_coroutine_impl< R > impl_type; - BOOST_MOVABLE_BUT_NOT_COPYABLE( symmetric_coroutine_self) + BOOST_MOVABLE_BUT_NOT_COPYABLE( symmetric_coroutine_yield) impl_type * impl_; R * result_; - symmetric_coroutine_self( impl_type * impl, R * result) BOOST_NOEXCEPT : + symmetric_coroutine_yield( impl_type * impl, R * result) BOOST_NOEXCEPT : impl_( impl), result_( result) { @@ -52,18 +52,18 @@ private: } public: - symmetric_coroutine_self() BOOST_NOEXCEPT : + symmetric_coroutine_yield() BOOST_NOEXCEPT : impl_( 0) {} - symmetric_coroutine_self( BOOST_RV_REF( symmetric_coroutine_self) other) BOOST_NOEXCEPT : + symmetric_coroutine_yield( BOOST_RV_REF( symmetric_coroutine_yield) other) BOOST_NOEXCEPT : impl_( 0), result_( 0) { swap( other); } - symmetric_coroutine_self & operator=( BOOST_RV_REF( symmetric_coroutine_self) other) BOOST_NOEXCEPT + symmetric_coroutine_yield & operator=( BOOST_RV_REF( symmetric_coroutine_yield) other) BOOST_NOEXCEPT { - symmetric_coroutine_self tmp( boost::move( other) ); + symmetric_coroutine_yield tmp( boost::move( other) ); swap( tmp); return * this; } @@ -73,20 +73,20 @@ public: bool operator!() const BOOST_NOEXCEPT { return 0 == impl_; } - void swap( symmetric_coroutine_self & other) BOOST_NOEXCEPT + void swap( symmetric_coroutine_yield & other) BOOST_NOEXCEPT { std::swap( impl_, other.impl_); std::swap( result_, other.result_); } - symmetric_coroutine_self & operator()() + symmetric_coroutine_yield & operator()() { result_ = impl_->yield(); return * this; } template< typename Coro > - symmetric_coroutine_self & operator()( Coro & other, typename Coro::value_type & x) + symmetric_coroutine_yield & operator()( Coro & other, typename Coro::value_type & x) { BOOST_ASSERT( other); @@ -95,7 +95,7 @@ public: } template< typename Coro > - symmetric_coroutine_self & operator()( Coro & other) + symmetric_coroutine_yield & operator()( Coro & other) { BOOST_ASSERT( other); @@ -112,7 +112,7 @@ public: }; template< typename R > -class symmetric_coroutine_self< R & > +class symmetric_coroutine_yield< R & > { private: template< typename X, typename Y, typename Z > @@ -123,12 +123,12 @@ private: struct dummy {}; - BOOST_MOVABLE_BUT_NOT_COPYABLE( symmetric_coroutine_self) + BOOST_MOVABLE_BUT_NOT_COPYABLE( symmetric_coroutine_yield) impl_type * impl_; R * result_; - symmetric_coroutine_self( impl_type * impl, R * result) BOOST_NOEXCEPT : + symmetric_coroutine_yield( impl_type * impl, R * result) BOOST_NOEXCEPT : impl_( impl), result_( result) { @@ -137,18 +137,18 @@ private: } public: - symmetric_coroutine_self() BOOST_NOEXCEPT : + symmetric_coroutine_yield() BOOST_NOEXCEPT : impl_( 0) {} - symmetric_coroutine_self( BOOST_RV_REF( symmetric_coroutine_self) other) BOOST_NOEXCEPT : + symmetric_coroutine_yield( BOOST_RV_REF( symmetric_coroutine_yield) other) BOOST_NOEXCEPT : impl_( 0), result_( 0) { swap( other); } - symmetric_coroutine_self & operator=( BOOST_RV_REF( symmetric_coroutine_self) other) BOOST_NOEXCEPT + symmetric_coroutine_yield & operator=( BOOST_RV_REF( symmetric_coroutine_yield) other) BOOST_NOEXCEPT { - symmetric_coroutine_self tmp( boost::move( other) ); + symmetric_coroutine_yield tmp( boost::move( other) ); swap( tmp); return * this; } @@ -158,20 +158,20 @@ public: bool operator!() const BOOST_NOEXCEPT { return 0 == impl_; } - void swap( symmetric_coroutine_self & other) BOOST_NOEXCEPT + void swap( symmetric_coroutine_yield & other) BOOST_NOEXCEPT { std::swap( impl_, other.impl_); std::swap( result_, other.result_); } - symmetric_coroutine_self & operator()() + symmetric_coroutine_yield & operator()() { result_ = impl_->yield(); return * this; } template< typename Coro > - symmetric_coroutine_self & operator()( Coro & other, typename Coro::value_type & x) + symmetric_coroutine_yield & operator()( Coro & other, typename Coro::value_type & x) { BOOST_ASSERT( other); @@ -180,7 +180,7 @@ public: } template< typename Coro > - symmetric_coroutine_self & operator()( Coro & other) + symmetric_coroutine_yield & operator()( Coro & other) { BOOST_ASSERT( other); @@ -197,7 +197,7 @@ public: }; template<> -class symmetric_coroutine_self< void > +class symmetric_coroutine_yield< void > { private: template< typename X, typename Y, typename Z > @@ -206,26 +206,26 @@ private: typedef parameters< void > param_type; typedef symmetric_coroutine_impl< void > impl_type; - BOOST_MOVABLE_BUT_NOT_COPYABLE( symmetric_coroutine_self) + BOOST_MOVABLE_BUT_NOT_COPYABLE( symmetric_coroutine_yield) impl_type * impl_; - symmetric_coroutine_self( impl_type * impl) BOOST_NOEXCEPT : + symmetric_coroutine_yield( impl_type * impl) BOOST_NOEXCEPT : impl_( impl) { BOOST_ASSERT( impl_); } public: - symmetric_coroutine_self() BOOST_NOEXCEPT : + symmetric_coroutine_yield() BOOST_NOEXCEPT : impl_( 0) {} - symmetric_coroutine_self( BOOST_RV_REF( symmetric_coroutine_self) other) BOOST_NOEXCEPT : + symmetric_coroutine_yield( BOOST_RV_REF( symmetric_coroutine_yield) other) BOOST_NOEXCEPT : impl_( 0) { swap( other); } - symmetric_coroutine_self & operator=( BOOST_RV_REF( symmetric_coroutine_self) other) BOOST_NOEXCEPT + symmetric_coroutine_yield & operator=( BOOST_RV_REF( symmetric_coroutine_yield) other) BOOST_NOEXCEPT { - symmetric_coroutine_self tmp( boost::move( other) ); + symmetric_coroutine_yield tmp( boost::move( other) ); swap( tmp); return * this; } @@ -235,17 +235,17 @@ public: bool operator!() const BOOST_NOEXCEPT { return 0 == impl_; } - void swap( symmetric_coroutine_self & other) BOOST_NOEXCEPT + void swap( symmetric_coroutine_yield & other) BOOST_NOEXCEPT { std::swap( impl_, other.impl_); } - symmetric_coroutine_self & operator()() + symmetric_coroutine_yield & operator()() { impl_->yield(); return * this; } template< typename Coro > - symmetric_coroutine_self & operator()( Coro & other, typename Coro::value_type & x) + symmetric_coroutine_yield & operator()( Coro & other, typename Coro::value_type & x) { BOOST_ASSERT( other); @@ -254,7 +254,7 @@ public: } template< typename Coro > - symmetric_coroutine_self & operator()( Coro & other) + symmetric_coroutine_yield & operator()( Coro & other) { BOOST_ASSERT( other); @@ -264,7 +264,7 @@ public: }; template< typename R > -void swap( symmetric_coroutine_self< R > & l, symmetric_coroutine_self< R > & r) +void swap( symmetric_coroutine_yield< R > & l, symmetric_coroutine_yield< R > & r) { l.swap( r); } }}} @@ -273,4 +273,4 @@ void swap( symmetric_coroutine_self< R > & l, symmetric_coroutine_self< R > & r) # include BOOST_ABI_SUFFIX #endif -#endif // BOOST_COROUTINES_DETAIL_SYMMETRIC_COROUTINE_SELF_H +#endif // BOOST_COROUTINES_DETAIL_SYMMETRIC_COROUTINE_YIELD_H diff --git a/include/boost/coroutine/detail/trampoline.hpp b/include/boost/coroutine/detail/trampoline.hpp index a7c23a3..da795cb 100644 --- a/include/boost/coroutine/detail/trampoline.hpp +++ b/include/boost/coroutine/detail/trampoline.hpp @@ -60,10 +60,10 @@ void trampoline( intptr_t vp) reinterpret_cast< intptr_t >( & c), c.preserve_fpu() ) ) ); - // create self_type - Self self( & c, from->data); + // create yield_type + Self yield( & c, from->data); try - { fn( self); } + { fn( yield); } catch ( forced_unwind const&) {} catch (...) @@ -101,10 +101,10 @@ void trampoline_void( intptr_t vp) reinterpret_cast< intptr_t >( & c), c.preserve_fpu() ); - // create self_type - Self self( & c); + // create yield_type + Self yield( & c); try - { fn( self); } + { fn( yield); } catch ( forced_unwind const&) {} catch (...) diff --git a/include/boost/coroutine/detail/trampoline_pull.hpp b/include/boost/coroutine/detail/trampoline_pull.hpp index 8babd9d..b0f4862 100644 --- a/include/boost/coroutine/detail/trampoline_pull.hpp +++ b/include/boost/coroutine/detail/trampoline_pull.hpp @@ -62,9 +62,9 @@ void trampoline_pull( intptr_t vp) // create push_coroutine typename Self::impl_type b( c.callee_, c.caller_, false, c.preserve_fpu() ); - Self self( & b); + Self yield( & b); try - { fn( self); } + { fn( yield); } catch ( forced_unwind const&) {} catch (...) @@ -108,9 +108,9 @@ void trampoline_pull_void( intptr_t vp) // create push_coroutine typename Self::impl_type b( c.callee_, c.caller_, false, c.preserve_fpu() ); - Self self( & b); + Self yield( & b); try - { fn( self); } + { fn( yield); } catch ( forced_unwind const&) {} catch (...) diff --git a/include/boost/coroutine/detail/trampoline_push.hpp b/include/boost/coroutine/detail/trampoline_push.hpp index 86cf375..abac5d4 100644 --- a/include/boost/coroutine/detail/trampoline_push.hpp +++ b/include/boost/coroutine/detail/trampoline_push.hpp @@ -62,9 +62,9 @@ void trampoline_push( intptr_t vp) // create push_coroutine typename Self::impl_type b( c.callee_, c.caller_, false, c.preserve_fpu(), from->data); - Self self( & b); + Self yield( & b); try - { fn( self); } + { fn( yield); } catch ( forced_unwind const&) {} catch (...) @@ -108,9 +108,9 @@ void trampoline_push_void( intptr_t vp) // create push_coroutine typename Self::impl_type b( c.callee_, c.caller_, false, c.preserve_fpu() ); - Self self( & b); + Self yield( & b); try - { fn( self); } + { fn( yield); } catch ( forced_unwind const&) {} catch (...) diff --git a/include/boost/coroutine/symmetric_coroutine.hpp b/include/boost/coroutine/symmetric_coroutine.hpp index de36b13..9bdd8c8 100644 --- a/include/boost/coroutine/symmetric_coroutine.hpp +++ b/include/boost/coroutine/symmetric_coroutine.hpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -38,7 +38,7 @@ class symmetric_coroutine { private: template< typename X > - friend class detail::symmetric_coroutine_self; + friend class detail::symmetric_coroutine_yield; typedef detail::symmetric_coroutine_impl< Arg > impl_type; typedef detail::parameters< Arg > param_type; @@ -55,7 +55,7 @@ private: public: typedef Arg value_type; - typedef detail::symmetric_coroutine_self< Arg > self_type; + typedef detail::symmetric_coroutine_yield< Arg > yield_type; symmetric_coroutine() BOOST_NOEXCEPT : impl_( 0), @@ -67,7 +67,7 @@ public: #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES # ifdef BOOST_MSVC - typedef void ( * coroutine_fn)( self_type &); + typedef void ( * coroutine_fn)( yield_type &); explicit symmetric_coroutine( coroutine_fn fn, attributes const& attr = attributes() ) : @@ -79,7 +79,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< coroutine_fn, impl_type, self_type >, + detail::trampoline< coroutine_fn, impl_type, yield_type >, & stack_ctx_); detail::setup< coroutine_fn > to( forward< coroutine_fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -101,7 +101,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< coroutine_fn, impl_type, self_type >, + detail::trampoline< coroutine_fn, impl_type, yield_type >, & stack_ctx_); detail::setup< coroutine_fn > to( forward< coroutine_fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -123,7 +123,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( forward< Fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -146,7 +146,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( forward< Fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -172,7 +172,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -198,7 +198,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -224,7 +224,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -251,7 +251,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -325,7 +325,7 @@ class symmetric_coroutine< Arg &, StackAllocator > { private: template< typename X > - friend class detail::symmetric_coroutine_self; + friend class detail::symmetric_coroutine_yield; typedef detail::symmetric_coroutine_impl< Arg & > impl_type; typedef detail::parameters< Arg & > param_type; @@ -342,7 +342,7 @@ private: public: typedef Arg value_type; - typedef detail::symmetric_coroutine_self< Arg & > self_type; + typedef detail::symmetric_coroutine_yield< Arg & > yield_type; symmetric_coroutine() BOOST_NOEXCEPT : impl_( 0), @@ -354,7 +354,7 @@ public: #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES # ifdef BOOST_MSVC - typedef void ( * coroutine_fn)( self_type &); + typedef void ( * coroutine_fn)( yield_type &); explicit symmetric_coroutine( coroutine_fn fn, attributes const& attr = attributes() ) : @@ -366,7 +366,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< coroutine_fn, impl_type, self_type >, + detail::trampoline< coroutine_fn, impl_type, yield_type >, & stack_ctx_); detail::setup< coroutine_fn > to( forward< coroutine_fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -388,7 +388,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< coroutine_fn, impl_type, self_type >, + detail::trampoline< coroutine_fn, impl_type, yield_type >, & stack_ctx_); detail::setup< coroutine_fn > to( forward< coroutine_fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -410,7 +410,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( forward< Fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -433,7 +433,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( forward< Fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -459,7 +459,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -485,7 +485,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -511,7 +511,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -538,7 +538,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline< Fn, impl_type, self_type >, + detail::trampoline< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -604,7 +604,7 @@ class symmetric_coroutine< void, StackAllocator > { private: template< typename X > - friend class detail::symmetric_coroutine_self; + friend class detail::symmetric_coroutine_yield; typedef detail::symmetric_coroutine_impl< void > impl_type; typedef detail::parameters< void > param_type; @@ -621,7 +621,7 @@ private: public: typedef void value_type; - typedef detail::symmetric_coroutine_self< void > self_type; + typedef detail::symmetric_coroutine_yield< void > yield_type; symmetric_coroutine() BOOST_NOEXCEPT : impl_( 0), @@ -633,7 +633,7 @@ public: #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES # ifdef BOOST_MSVC - typedef void ( * coroutine_fn)( self_type &); + typedef void ( * coroutine_fn)( yield_type &); explicit symmetric_coroutine( coroutine_fn fn, attributes const& attr = attributes() ) : @@ -645,7 +645,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline_void< coroutine_fn, impl_type, self_type >, + detail::trampoline_void< coroutine_fn, impl_type, yield_type >, & stack_ctx_); detail::setup< coroutine_fn > to( forward< coroutine_fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -667,7 +667,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline_void< coroutine_fn, impl_type, self_type >, + detail::trampoline_void< coroutine_fn, impl_type, yield_type >, & stack_ctx_); detail::setup< coroutine_fn > to( forward< coroutine_fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -689,7 +689,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline_void< Fn, impl_type, self_type >, + detail::trampoline_void< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( forward< Fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -712,7 +712,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline_void< Fn, impl_type, self_type >, + detail::trampoline_void< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( forward< Fn >( fn), & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -738,7 +738,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline_void< Fn, impl_type, self_type >, + detail::trampoline_void< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -764,7 +764,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline_void< Fn, impl_type, self_type >, + detail::trampoline_void< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -790,7 +790,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline_void< Fn, impl_type, self_type >, + detail::trampoline_void< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( @@ -817,7 +817,7 @@ public: { stack_alloc_.allocate( stack_ctx_, attr.size); callee_ = detail::coroutine_context( - detail::trampoline_void< Fn, impl_type, self_type >, + detail::trampoline_void< Fn, impl_type, yield_type >, & stack_ctx_); detail::setup< Fn > to( fn, & caller_, & callee_, attr); impl_ = reinterpret_cast< impl_type * >( diff --git a/performance/bind_processor_aix.cpp b/performance/bind_processor_aix.cpp index 7ddc2eb..8c477fc 100644 --- a/performance/bind_processor_aix.cpp +++ b/performance/bind_processor_aix.cpp @@ -18,7 +18,7 @@ extern "C" void bind_to_processor( unsigned int n) { - if ( ::bindprocessor( BINDTHREAD, ::thread_self(), static_cast< cpu_t >( n) ) == -1) + if ( ::bindprocessor( BINDTHREAD, ::thread_yield(), static_cast< cpu_t >( n) ) == -1) throw std::runtime_error("::bindprocessor() failed"); } diff --git a/performance/bind_processor_linux.cpp b/performance/bind_processor_linux.cpp index 3fb9588..1284c9e 100644 --- a/performance/bind_processor_linux.cpp +++ b/performance/bind_processor_linux.cpp @@ -22,7 +22,7 @@ void bind_to_processor( unsigned int n) CPU_ZERO( & cpuset); CPU_SET( n, & cpuset); - int errno_( ::pthread_setaffinity_np( ::pthread_self(), sizeof( cpuset), & cpuset) ); + int errno_( ::pthread_setaffinity_np( ::pthread_yield(), sizeof( cpuset), & cpuset) ); if ( errno_ != 0) throw std::runtime_error("::pthread_setaffinity_np() failed"); } diff --git a/performance/symmetric/performance_create_prealloc.cpp b/performance/symmetric/performance_create_prealloc.cpp index 307b0a6..8934f1d 100644 --- a/performance/symmetric/performance_create_prealloc.cpp +++ b/performance/symmetric/performance_create_prealloc.cpp @@ -25,7 +25,7 @@ boost::coroutines::flag_fpu_t preserve_fpu = boost::coroutines::fpu_not_preserve boost::coroutines::flag_unwind_t unwind_stack = boost::coroutines::stack_unwind; boost::uint64_t jobs = 1000; -void fn( coro_type::self_type &) {} +void fn( coro_type::yield_type &) {} duration_type measure_time( duration_type overhead) { diff --git a/performance/symmetric/performance_create_protected.cpp b/performance/symmetric/performance_create_protected.cpp index fa68d4d..34e87b3 100644 --- a/performance/symmetric/performance_create_protected.cpp +++ b/performance/symmetric/performance_create_protected.cpp @@ -24,7 +24,7 @@ boost::coroutines::flag_fpu_t preserve_fpu = boost::coroutines::fpu_not_preserve boost::coroutines::flag_unwind_t unwind_stack = boost::coroutines::stack_unwind; boost::uint64_t jobs = 1000; -void fn( coro_type::self_type &) {} +void fn( coro_type::yield_type &) {} duration_type measure_time( duration_type overhead) { diff --git a/performance/symmetric/performance_create_standard.cpp b/performance/symmetric/performance_create_standard.cpp index 9f47074..220ea4a 100644 --- a/performance/symmetric/performance_create_standard.cpp +++ b/performance/symmetric/performance_create_standard.cpp @@ -24,7 +24,7 @@ boost::coroutines::flag_fpu_t preserve_fpu = boost::coroutines::fpu_not_preserve boost::coroutines::flag_unwind_t unwind_stack = boost::coroutines::stack_unwind; boost::uint64_t jobs = 1000; -void fn( coro_type::self_type &) {} +void fn( coro_type::yield_type &) {} duration_type measure_time( duration_type overhead) { diff --git a/performance/symmetric/performance_switch.cpp b/performance/symmetric/performance_switch.cpp index 671888c..853cd3c 100644 --- a/performance/symmetric/performance_switch.cpp +++ b/performance/symmetric/performance_switch.cpp @@ -33,13 +33,13 @@ struct X const X x("abc"); -void fn_void( boost::coroutines::symmetric_coroutine< void >::self_type &) +void fn_void( boost::coroutines::symmetric_coroutine< void >::yield_type &) {} -void fn_int( boost::coroutines::symmetric_coroutine< int >::self_type &) +void fn_int( boost::coroutines::symmetric_coroutine< int >::yield_type &) {} -void fn_x( boost::coroutines::symmetric_coroutine< X >::self_type &) +void fn_x( boost::coroutines::symmetric_coroutine< X >::yield_type &) {} duration_type measure_time_void( duration_type overhead) diff --git a/performance/symmetric/segmented/performance_create_segmented.cpp b/performance/symmetric/segmented/performance_create_segmented.cpp index 53afe57..d5d0ca7 100644 --- a/performance/symmetric/segmented/performance_create_segmented.cpp +++ b/performance/symmetric/segmented/performance_create_segmented.cpp @@ -20,7 +20,7 @@ boost::coroutines::flag_fpu_t preserve_fpu = boost::coroutines::fpu_not_preserved; boost::uint64_t jobs = 1000; -void fn( boost::coroutines::symmetric_coroutine< void >::self_type &) {} +void fn( boost::coroutines::symmetric_coroutine< void >::yield_type &) {} duration_type measure_time( duration_type overhead) { diff --git a/test/test_symmetric_coroutine.cpp b/test/test_symmetric_coroutine.cpp index 67b89a1..8b4f866 100644 --- a/test/test_symmetric_coroutine.cpp +++ b/test/test_symmetric_coroutine.cpp @@ -71,7 +71,7 @@ public: state( true) {} - void operator()( coro::symmetric_coroutine< int >::self_type &) + void operator()( coro::symmetric_coroutine< int >::yield_type &) { value1 = state; } }; @@ -103,105 +103,105 @@ public: return * this; } - void operator()( coro::symmetric_coroutine< int >::self_type &) + void operator()( coro::symmetric_coroutine< int >::yield_type &) { value1 = state; } }; -void empty( coro::symmetric_coroutine< void >::self_type &) {} +void empty( coro::symmetric_coroutine< void >::yield_type &) {} -void f2( coro::symmetric_coroutine< void >::self_type &) +void f2( coro::symmetric_coroutine< void >::yield_type &) { ++value2; } -void f3( coro::symmetric_coroutine< X >::self_type & self) -{ value2 = self.get().i; } +void f3( coro::symmetric_coroutine< X >::yield_type & yield) +{ value2 = yield.get().i; } -void f4( coro::symmetric_coroutine< X& >::self_type & self) +void f4( coro::symmetric_coroutine< X& >::yield_type & yield) { - X & x = self.get(); + X & x = yield.get(); p = & x; } -void f5( coro::symmetric_coroutine< X* >::self_type & self) -{ p = self.get(); } +void f5( coro::symmetric_coroutine< X* >::yield_type & yield) +{ p = yield.get(); } -void f6( coro::symmetric_coroutine< void >::self_type & self) +void f6( coro::symmetric_coroutine< void >::yield_type & yield) { Y y; - self( *term_coro); + yield( *term_coro); } -void f7( coro::symmetric_coroutine< int >::self_type & self) +void f7( coro::symmetric_coroutine< int >::yield_type & yield) { - value2 = self.get(); - self( *term_coro); - value2 = self.get(); + value2 = yield.get(); + yield( *term_coro); + value2 = yield.get(); } template< typename E > -void f9( coro::symmetric_coroutine< void >::self_type &, E const& e) +void f9( coro::symmetric_coroutine< void >::yield_type &, E const& e) { throw e; } -void f10( coro::symmetric_coroutine< int >::self_type & self, +void f10( coro::symmetric_coroutine< int >::yield_type & yield, coro::symmetric_coroutine< int > & other) { - int i = self.get(); - self( other, i); - value2 = self.get(); + int i = yield.get(); + yield( other, i); + value2 = yield.get(); } -void f101( coro::symmetric_coroutine< int >::self_type & self) -{ value2 = self.get(); } +void f101( coro::symmetric_coroutine< int >::yield_type & yield) +{ value2 = yield.get(); } -void f11( coro::symmetric_coroutine< void >::self_type & self, +void f11( coro::symmetric_coroutine< void >::yield_type & yield, coro::symmetric_coroutine< void > & other) { - self( other); + yield( other); value2 = 7; } -void f111( coro::symmetric_coroutine< void >::self_type &) +void f111( coro::symmetric_coroutine< void >::yield_type &) { value2 = 3; } -void f12( coro::symmetric_coroutine< X& >::self_type & self, +void f12( coro::symmetric_coroutine< X& >::yield_type & yield, coro::symmetric_coroutine< X& > & other) { - self( other, self.get()); - p = & self.get(); + yield( other, yield.get()); + p = & yield.get(); } -void f121( coro::symmetric_coroutine< X& >::self_type & self) -{ p = & self.get(); } +void f121( coro::symmetric_coroutine< X& >::yield_type & yield) +{ p = & yield.get(); } -void f14( coro::symmetric_coroutine< int >::self_type & self, +void f14( coro::symmetric_coroutine< int >::yield_type & yield, coro::symmetric_coroutine< std::string > & other) { - std::string str( boost::lexical_cast< std::string >( self.get() ) ); - self( other, str); - value2 = self.get(); + std::string str( boost::lexical_cast< std::string >( yield.get() ) ); + yield( other, str); + value2 = yield.get(); } -void f141( coro::symmetric_coroutine< std::string >::self_type & self) -{ value3 = self.get(); } +void f141( coro::symmetric_coroutine< std::string >::yield_type & yield) +{ value3 = yield.get(); } -void f15( coro::symmetric_coroutine< int >::self_type & self, +void f15( coro::symmetric_coroutine< int >::yield_type & yield, int offset, coro::symmetric_coroutine< int > & other) { - int x = self.get(); + int x = yield.get(); value2 += x + offset; - self( other, x); - x = self.get(); + yield( other, x); + x = yield.get(); value2 += x + offset; - self( other, x); + yield( other, x); } -void f151( coro::symmetric_coroutine< int >::self_type & self, +void f151( coro::symmetric_coroutine< int >::yield_type & yield, int offset) { - int x = self.get(); + int x = yield.get(); value2 += x + offset; - self(); - x = self.get(); + yield(); + x = yield.get(); value2 += x + offset; }