mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-20 14:42:21 +00:00
join fiber in its destructor
This commit is contained in:
@@ -305,6 +305,9 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
~fiber()
|
||||
{ if ( impl_) join(); }
|
||||
|
||||
fiber( BOOST_RV_REF( fiber) other) BOOST_NOEXCEPT :
|
||||
impl_()
|
||||
{ swap( other); }
|
||||
|
||||
@@ -190,7 +190,7 @@ void test_cancel()
|
||||
// s' yields in its fiber-fn
|
||||
// s cancels s' and completes
|
||||
stm::fiber s( f3);
|
||||
BOOST_CHECK( stm::run() );
|
||||
BOOST_CHECK( ! stm::run() );
|
||||
BOOST_CHECK( ! s);
|
||||
BOOST_CHECK( ! stm::run() );
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ void wait_for_either_invokes_callbacks()
|
||||
stm::unique_future<int> fi2=pt2.get_future();
|
||||
pt.set_wait_callback(wait_callback_for_task);
|
||||
|
||||
stm::fiber(boost::move(pt));
|
||||
stm::fiber f(boost::move(pt));
|
||||
stm::waitfor_any(fi,fi2);
|
||||
|
||||
BOOST_CHECK(fi.get()==42);
|
||||
|
||||
Reference in New Issue
Block a user