2
0
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:
Oliver Kowalke
2014-03-08 19:38:12 +01:00
parent 5d6c392463
commit 49d223fe1a
2 changed files with 2 additions and 14 deletions

View File

@@ -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;

View File

@@ -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;
}