diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:38:45 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2016-10-06 10:39:52 +0900 |
commit | 5cde13f21d36c7224b0e13d11c4b49379ae5210d (patch) | |
tree | e8269ac85a4b0f7d416e2565fa4f451b5cb41351 /boost/coroutine/detail/trampoline_push.hpp | |
parent | d9ec475d945d3035377a0d89ed42e382d8988891 (diff) | |
download | boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.gz boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.tar.bz2 boost-5cde13f21d36c7224b0e13d11c4b49379ae5210d.zip |
Imported Upstream version 1.61.0
Change-Id: I96a1f878d1e6164f01e9aadd5147f38fca448d90
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/coroutine/detail/trampoline_push.hpp')
-rw-r--r-- | boost/coroutine/detail/trampoline_push.hpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/boost/coroutine/detail/trampoline_push.hpp b/boost/coroutine/detail/trampoline_push.hpp index 448904456e..80f90d0518 100644 --- a/boost/coroutine/detail/trampoline_push.hpp +++ b/boost/coroutine/detail/trampoline_push.hpp @@ -11,11 +11,13 @@ #include <boost/assert.hpp> #include <boost/config.hpp> +#include <boost/context/detail/fcontext.hpp> #include <boost/cstdint.hpp> #include <boost/exception_ptr.hpp> #include <boost/move/move.hpp> #include <boost/coroutine/detail/config.hpp> +#include <boost/coroutine/detail/data.hpp> #include <boost/coroutine/detail/flags.hpp> #include <boost/coroutine/detail/parameters.hpp> #include <boost/coroutine/detail/setup.hpp> @@ -32,37 +34,37 @@ namespace coroutines { namespace detail { template< typename Coro > -void trampoline_push( intptr_t vp) +void trampoline_push( context::detail::transfer_t t) { typedef typename Coro::param_type param_type; - BOOST_ASSERT( vp); - + data_t * data = static_cast< data_t * >( t.data); + data->from->ctx_ = t.fctx; param_type * param( - reinterpret_cast< param_type * >( vp) ); + static_cast< param_type * >( data->data) ); BOOST_ASSERT( 0 != param); BOOST_ASSERT( 0 != param->data); Coro * coro( - reinterpret_cast< Coro * >( param->coro) ); + static_cast< Coro * >( param->coro) ); BOOST_ASSERT( 0 != coro); coro->run( param->data); } template< typename Coro > -void trampoline_push_void( intptr_t vp) +void trampoline_push_void( context::detail::transfer_t t) { typedef typename Coro::param_type param_type; - BOOST_ASSERT( vp); - + data_t * data = static_cast< data_t * >( t.data); + data->from->ctx_ = t.fctx; param_type * param( - reinterpret_cast< param_type * >( vp) ); + static_cast< param_type * >( data->data) ); BOOST_ASSERT( 0 != param); Coro * coro( - reinterpret_cast< Coro * >( param->coro) ); + static_cast< Coro * >( param->coro) ); BOOST_ASSERT( 0 != coro); coro->run(); |