mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-15 00:52:34 +00:00
tests
This commit is contained in:
@@ -71,7 +71,7 @@ fiber_base::release()
|
||||
// so they can be resumed
|
||||
// protect against concurrent access to joining_
|
||||
unique_lock< spinlock > lk( joining_mtx_);
|
||||
BOOST_FOREACH( fiber_base::ptr_t & p, joining_)
|
||||
BOOST_FOREACH( fiber_base::ptr_t p, joining_)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << p->get_id();
|
||||
|
||||
@@ -25,8 +25,8 @@ namespace boost {
|
||||
namespace fibers {
|
||||
|
||||
void
|
||||
fiber::spawn_( detail::fiber_base::ptr_t const& f)
|
||||
{ detail::scheduler::instance().add( f); }
|
||||
fiber::spawn_( fiber & f)
|
||||
{ detail::scheduler::instance().migrate_to( f); }
|
||||
|
||||
int
|
||||
fiber::priority() const
|
||||
|
||||
@@ -34,7 +34,7 @@ mutex::lock()
|
||||
{
|
||||
while ( LOCKED == state_.exchange( LOCKED, memory_order_seq_cst) )
|
||||
{
|
||||
if ( ! this_fiber::is_fiberized() ) ::abort();
|
||||
BOOST_ASSERT( this_fiber::is_fiberized() );
|
||||
|
||||
unique_lock< detail::spinlock > lk( waiting_mtx_);
|
||||
waiting_.push_back(
|
||||
|
||||
@@ -54,16 +54,6 @@ round_robin::~round_robin()
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
round_robin::add( detail::fiber_base::ptr_t const& f)
|
||||
{
|
||||
BOOST_ASSERT( f);
|
||||
BOOST_ASSERT( ! f->is_running() );
|
||||
BOOST_ASSERT( ! f->is_terminated() );
|
||||
|
||||
wqueue_.push_back( f);
|
||||
}
|
||||
|
||||
bool
|
||||
round_robin::run()
|
||||
{
|
||||
@@ -228,9 +218,14 @@ round_robin::priority( detail::fiber_base::ptr_t const& f, int prio)
|
||||
}
|
||||
|
||||
void
|
||||
round_robin::migrate_to( BOOST_RV_REF( fiber) f)
|
||||
round_robin::migrate_to( fiber const& f_)
|
||||
{
|
||||
add( detail::scheduler::extract( f) );
|
||||
detail::fiber_base::ptr_t f = detail::scheduler::extract( f_);
|
||||
BOOST_ASSERT( f);
|
||||
BOOST_ASSERT( ! f->is_running() );
|
||||
BOOST_ASSERT( ! f->is_terminated() );
|
||||
|
||||
wqueue_.push_back( f);
|
||||
}
|
||||
|
||||
fiber
|
||||
|
||||
Reference in New Issue
Block a user