2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-22 03:12:28 +00:00

introduce new queue for terminated fibers

This commit is contained in:
Oliver Kowalke
2015-06-13 08:14:14 +02:00
parent 19b3076467
commit e2404eefd7
5 changed files with 118 additions and 14 deletions

View File

@@ -111,23 +111,13 @@ fiber_manager::run() {
BOOST_ASSERT_MSG( f->is_ready(), "fiber with invalid state in ready-queue");
// destroy terminated fibers from tqueue_
while ( ! tqueue_.empty() ) {
fiber_context * f_( tqueue_.pop() );
BOOST_ASSERT( nullptr != f_);
BOOST_ASSERT( f_->is_terminated() );
intrusive_ptr_release( f_);
}
tqueue_.clear();
// resume fiber f
resume_( f);
// destroy terminated fibers from tqueue_
while ( ! tqueue_.empty() ) {
fiber_context * f_( tqueue_.pop() );
BOOST_ASSERT( nullptr != f_);
BOOST_ASSERT( f_->is_terminated() );
intrusive_ptr_release( f_);
}
tqueue_.clear();
return;
} else {