From bca9dd2a13551e0a58c64be3d05cc3de91f58e04 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Fri, 3 Apr 2015 09:56:46 +0200 Subject: [PATCH] remove jump back to caller after termination - if coroutine function terminates execution_context already jumps back to its parent (caller) --- include/boost/coroutine2/detail/pull_control_block.ipp | 9 --------- include/boost/coroutine2/detail/push_control_block.ipp | 9 --------- 2 files changed, 18 deletions(-) diff --git a/include/boost/coroutine2/detail/pull_control_block.ipp b/include/boost/coroutine2/detail/pull_control_block.ipp index 1b1b573..a8ca06f 100644 --- a/include/boost/coroutine2/detail/pull_control_block.ipp +++ b/include/boost/coroutine2/detail/pull_control_block.ipp @@ -48,9 +48,6 @@ pull_coroutine< T >::control_block::control_block( context::preallocated palloc, } // set termination flags state |= static_cast< int >( state_t::complete); - // jump back to caller - caller( preserve_fpu); - BOOST_ASSERT_MSG( false, "pull_coroutine is complete"); }), preserve_fpu( preserve_fpu_), state( static_cast< int >( state_t::unwind) ) { @@ -115,9 +112,6 @@ pull_coroutine< T & >::control_block::control_block( context::preallocated pallo } // set termination flags state |= static_cast< int >( state_t::complete); - // jump back to caller - caller( preserve_fpu); - BOOST_ASSERT_MSG( false, "pull_coroutine is complete"); }), preserve_fpu( preserve_fpu_), state( static_cast< int >( state_t::unwind) ) { @@ -181,9 +175,6 @@ pull_coroutine< void >::control_block::control_block( context::preallocated pall } // set termination flags state |= static_cast< int >( state_t::complete); - // jump back to caller - caller( preserve_fpu); - BOOST_ASSERT_MSG( false, "pull_coroutine is complete"); }), preserve_fpu( preserve_fpu_), state( static_cast< int >( state_t::unwind) ) { diff --git a/include/boost/coroutine2/detail/push_control_block.ipp b/include/boost/coroutine2/detail/push_control_block.ipp index 3786854..6ad2122 100644 --- a/include/boost/coroutine2/detail/push_control_block.ipp +++ b/include/boost/coroutine2/detail/push_control_block.ipp @@ -49,9 +49,6 @@ push_coroutine< T >::control_block::control_block( context::preallocated palloc, } // set termination flags state |= static_cast< int >( state_t::complete); - // jump back to caller - caller( preserve_fpu_); - BOOST_ASSERT_MSG( false, "push_coroutine is complete"); }), preserve_fpu( preserve_fpu_), state( static_cast< int >( state_t::unwind) ), @@ -137,9 +134,6 @@ push_coroutine< T & >::control_block::control_block( context::preallocated pallo } // set termination flags state |= static_cast< int >( state_t::complete); - // jump back to caller - caller( preserve_fpu_); - BOOST_ASSERT_MSG( false, "push_coroutine is complete"); }), preserve_fpu( preserve_fpu_), state( static_cast< int >( state_t::unwind) ), @@ -205,9 +199,6 @@ push_coroutine< void >::control_block::control_block( context::preallocated pall } // set termination flags state |= static_cast< int >( state_t::complete); - // jump back to caller - caller( preserve_fpu_); - BOOST_ASSERT_MSG( false, "push_coroutine is complete"); }), preserve_fpu( preserve_fpu_), state( static_cast< int >( state_t::unwind) ) {