mirror of
https://github.com/boostorg/coroutine2.git
synced 2025-05-09 15:14:01 +00:00
Merge branch 'develop'
This commit is contained in:
commit
f5c998e2a7
@ -39,7 +39,6 @@ pull_coroutine< T >::control_block::destroy( control_block * cb) noexcept {
|
||||
cb->~control_block();
|
||||
// destroy coroutine's stack
|
||||
cb->state |= state_t::destroy;
|
||||
c.resume();
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
@ -205,7 +204,6 @@ pull_coroutine< T & >::control_block::destroy( control_block * cb) noexcept {
|
||||
cb->~control_block();
|
||||
// destroy coroutine's stack
|
||||
cb->state |= state_t::destroy;
|
||||
c.resume();
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
@ -347,7 +345,6 @@ pull_coroutine< void >::control_block::destroy( control_block * cb) noexcept {
|
||||
cb->~control_block();
|
||||
// destroy coroutine's stack
|
||||
cb->state |= state_t::destroy;
|
||||
c.resume();
|
||||
}
|
||||
|
||||
template< typename StackAllocator, typename Fn >
|
||||
|
@ -38,7 +38,6 @@ push_coroutine< T >::control_block::destroy( control_block * cb) noexcept {
|
||||
cb->~control_block();
|
||||
// destroy coroutine's stack
|
||||
cb->state |= state_t::destroy;
|
||||
c.resume();
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
@ -171,7 +170,6 @@ push_coroutine< T & >::control_block::destroy( control_block * cb) noexcept {
|
||||
cb->~control_block();
|
||||
// destroy coroutine's stack
|
||||
cb->state |= state_t::destroy;
|
||||
c.resume();
|
||||
}
|
||||
|
||||
template< typename T >
|
||||
@ -294,7 +292,6 @@ push_coroutine< void >::control_block::destroy( control_block * cb) noexcept {
|
||||
cb->~control_block();
|
||||
// destroy coroutine's stack
|
||||
cb->state |= state_t::destroy;
|
||||
c.resume();
|
||||
}
|
||||
|
||||
template< typename StackAllocator, typename Fn >
|
||||
|
@ -470,7 +470,29 @@ void test_unwind()
|
||||
i = 7;
|
||||
});
|
||||
}
|
||||
BOOST_CHECK_EQUAL( ( int) 0, i);
|
||||
{
|
||||
BOOST_CHECK_EQUAL( ( int) 0, value1);
|
||||
auto * coro = new coro::coroutine< void >::pull_type(
|
||||
[](coro::coroutine< void >::push_type & coro) mutable {
|
||||
X x;
|
||||
coro();
|
||||
});
|
||||
BOOST_CHECK_EQUAL( ( int) 7, value1);
|
||||
delete coro;
|
||||
BOOST_CHECK_EQUAL( ( int) 0, value1);
|
||||
}
|
||||
{
|
||||
BOOST_CHECK_EQUAL( ( int) 0, value1);
|
||||
auto * coro = new coro::coroutine< void >::push_type(
|
||||
[](coro::coroutine< void >::pull_type & coro) mutable {
|
||||
X x;
|
||||
coro();
|
||||
});
|
||||
( * coro)();
|
||||
BOOST_CHECK_EQUAL( ( int) 7, value1);
|
||||
delete coro;
|
||||
BOOST_CHECK_EQUAL( ( int) 0, value1);
|
||||
}
|
||||
}
|
||||
|
||||
void test_exceptions()
|
||||
|
Loading…
x
Reference in New Issue
Block a user