assign current context in control_block destructor

- current context has to be assigned to priv. member variable 'other'
- otherwise stack unwinding will jump to an invalid context
This commit is contained in:
Oliver Kowalke 2016-08-01 17:31:03 +02:00
parent 60e78c48d7
commit 4669e551b9
2 changed files with 6 additions and 0 deletions

View File

@ -125,6 +125,7 @@ pull_coroutine< T >::control_block::~control_block() {
if ( state_t::none == ( state & state_t::complete) &&
state_t::none != ( state & state_t::unwind) ) {
// unwind coroutine stack
other->ctx = boost::context::execution_context::current();
ctx( context::exec_ontop_arg, unwind_coroutine);
}
// destroy data if it set
@ -273,6 +274,7 @@ pull_coroutine< T & >::control_block::~control_block() {
if ( state_t::none == ( state & state_t::complete) &&
state_t::none != ( state & state_t::unwind) ) {
// unwind coroutine stack
other->ctx = boost::context::execution_context::current();
ctx( context::exec_ontop_arg, unwind_coroutine);
}
}
@ -399,6 +401,7 @@ pull_coroutine< void >::control_block::~control_block() {
if ( state_t::none == ( state & state_t::complete) &&
state_t::none != ( state & state_t::unwind) ) {
// unwind coroutine stack
other->ctx = boost::context::execution_context::current();
ctx( context::exec_ontop_arg, unwind_coroutine);
}
}

View File

@ -130,6 +130,7 @@ push_coroutine< T >::control_block::~control_block() {
if ( state_t::none == ( state & state_t::complete) &&
state_t::none != ( state & state_t::unwind) ) {
// unwind coroutine stack
other->ctx = boost::context::execution_context::current();
ctx( context::exec_ontop_arg, unwind_coroutine);
}
}
@ -271,6 +272,7 @@ push_coroutine< T & >::control_block::~control_block() {
if ( state_t::none == ( state & state_t::complete) &&
state_t::none != ( state & state_t::unwind) ) {
// unwind coroutine stack
other->ctx = boost::context::execution_context::current();
ctx( context::exec_ontop_arg, unwind_coroutine);
}
}
@ -396,6 +398,7 @@ push_coroutine< void >::control_block::~control_block() {
if ( state_t::none == ( state & state_t::complete) &&
state_t::none != ( state & state_t::unwind) ) {
// unwind coroutine stack
other->ctx = boost::context::execution_context::current();
ctx( context::exec_ontop_arg, unwind_coroutine);
}
}