2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-17 01:32:32 +00:00

uses intrusive::list<> isntread hand-written queues

This commit is contained in:
Oliver Kowalke
2015-09-09 19:22:54 +02:00
parent e4fc7e7736
commit c89410dfd8
27 changed files with 334 additions and 619 deletions

View File

@@ -8,8 +8,6 @@
#include <boost/assert.hpp>
#include "boost/fiber/context.hpp"
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
@@ -21,14 +19,16 @@ void
round_robin::awakened( context * f) {
BOOST_ASSERT( nullptr != f);
rqueue_.push( f);
BOOST_ASSERT( ! f->state_is_linked() );
rqueue_.push_back( * f);
}
context *
round_robin::pick_next() {
context * victim( nullptr);
if ( ! rqueue_.empty() ) {
victim = rqueue_.pop();
victim = & rqueue_.front();
rqueue_.pop_front();
BOOST_ASSERT( nullptr != victim);
}
return victim;