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

some fixes

This commit is contained in:
Oliver Kowalke
2014-09-24 19:18:44 +02:00
parent 244c539a2e
commit 7fb469cd10
39 changed files with 728 additions and 1139 deletions

View File

@@ -26,18 +26,18 @@ condition::~condition()
void
condition::notify_one()
{
detail::fiber_base * n = 0;
detail::fiber_base * f( 0);
unique_lock< detail::spinlock > lk( splk_);
// get one waiting fiber
if ( ! waiting_.empty() ) {
n = waiting_.front();
f = waiting_.front();
waiting_.pop_front();
}
lk.unlock();
// notify waiting fiber
if ( n) n->set_ready();
if ( f) f->set_ready();
}
void
@@ -53,10 +53,10 @@ condition::notify_all()
// notify all waiting fibers
while ( ! waiting.empty() )
{
detail::fiber_base * n( waiting.front() );
detail::fiber_base * f( waiting.front() );
waiting.pop_front();
BOOST_ASSERT( n);
n->set_ready();
BOOST_ASSERT( f);
f->set_ready();
}
}