mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-14 12:42:28 +00:00
resume fiber on creation
This commit is contained in:
@@ -78,8 +78,6 @@ private:
|
||||
detail::main_fiber mn_;
|
||||
detail::main_fiber::ptr_t main_fiber_;
|
||||
|
||||
void resume_fiber_( detail::worker_fiber::ptr_t const&);
|
||||
|
||||
public:
|
||||
round_robin() BOOST_NOEXCEPT;
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ round_robin::~round_robin() BOOST_NOEXCEPT
|
||||
}
|
||||
|
||||
void
|
||||
round_robin::resume_fiber_( detail::worker_fiber::ptr_t const& f)
|
||||
round_robin::spawn( detail::worker_fiber::ptr_t const& f)
|
||||
{
|
||||
BOOST_ASSERT( f);
|
||||
BOOST_ASSERT( f->is_ready() );
|
||||
@@ -68,16 +68,6 @@ round_robin::resume_fiber_( detail::worker_fiber::ptr_t const& f)
|
||||
active_fiber_ = tmp;
|
||||
}
|
||||
|
||||
void
|
||||
round_robin::spawn( detail::worker_fiber::ptr_t const& f)
|
||||
{
|
||||
BOOST_ASSERT( f);
|
||||
BOOST_ASSERT( f->is_ready() );
|
||||
|
||||
// push active fiber to ready-queue
|
||||
rqueue_.push_back( f);
|
||||
}
|
||||
|
||||
bool
|
||||
round_robin::run()
|
||||
{
|
||||
@@ -120,7 +110,7 @@ round_robin::run()
|
||||
while ( true);
|
||||
|
||||
// resume fiber
|
||||
resume_fiber_( f);
|
||||
spawn( f);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user