mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-12 12:02:54 +00:00
some fixes
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user