Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83236 - in trunk: boost/coroutine/detail libs/coroutine/detail
From: oliver.kowalke_at_[hidden]
Date: 2013-03-01 18:01:30


Author: olli
Date: 2013-03-01 18:01:29 EST (Fri, 01 Mar 2013)
New Revision: 83236
URL: http://svn.boost.org/trac/boost/changeset/83236

Log:
coroutine: fix for segmented-stacks + parameter passing

Text files modified:
   trunk/boost/coroutine/detail/coroutine_context.hpp | 4 +---
   trunk/libs/coroutine/detail/coroutine_context.cpp | 20 ++++++++++++--------
   2 files changed, 13 insertions(+), 11 deletions(-)

Modified: trunk/boost/coroutine/detail/coroutine_context.hpp
==============================================================================
--- trunk/boost/coroutine/detail/coroutine_context.hpp (original)
+++ trunk/boost/coroutine/detail/coroutine_context.hpp 2013-03-01 18:01:29 EST (Fri, 01 Mar 2013)
@@ -12,7 +12,6 @@
 #include <boost/assert.hpp>
 #include <boost/config.hpp>
 #include <boost/context/fcontext.hpp>
-#include <boost/utility.hpp>
 
 #include <boost/coroutine/detail/config.hpp>
 #include "boost/coroutine/stack_context.hpp"
@@ -31,8 +30,7 @@
 namespace detail {
 
 
-class BOOST_COROUTINES_DECL coroutine_context : private noncopyable,
- private context::fcontext_t,
+class BOOST_COROUTINES_DECL coroutine_context : private context::fcontext_t,
                                                 private stack_context
                     
 {

Modified: trunk/libs/coroutine/detail/coroutine_context.cpp
==============================================================================
--- trunk/libs/coroutine/detail/coroutine_context.cpp (original)
+++ trunk/libs/coroutine/detail/coroutine_context.cpp 2013-03-01 18:01:29 EST (Fri, 01 Mar 2013)
@@ -64,15 +64,19 @@
 coroutine_context::jump( coroutine_context & other, intptr_t param, bool preserve_fpu)
 {
 #if defined(BOOST_USE_SEGMENTED_STACKS)
- if ( stack_ctx_)
- __splitstack_getcontext( stack_ctx_->segments_ctx);
- if ( other.stack_ctx_)
- __splitstack_setcontext( other.stack_ctx_->segments_ctx);
-#endif
+ BOOST_ASSERT( stack_ctx_);
+ BOOST_ASSERT( other.stack_ctx_);
+
+ __splitstack_getcontext( stack_ctx_->segments_ctx);
+ __splitstack_setcontext( other.stack_ctx_->segments_ctx);
+ intptr_t ret = context::jump_fcontext( ctx_, other.ctx_, param, preserve_fpu);
+
+ BOOST_ASSERT( stack_ctx_);
+ __splitstack_setcontext( stack_ctx_->segments_ctx);
+
+ return ret;
+#else
     return context::jump_fcontext( ctx_, other.ctx_, param, preserve_fpu);
-#if defined(BOOST_USE_SEGMENTED_STACKS)
- if ( stack_ctx_)
- __splitstack_setcontext( stack_ctx_->segments_ctx);
 #endif
 }
 


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