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

atomic-ops removed

This commit is contained in:
Oliver Kowalke
2013-03-19 18:19:27 +01:00
parent c864e02fca
commit 5396888ec3
18 changed files with 65 additions and 180 deletions

View File

@@ -20,7 +20,6 @@ namespace boost {
namespace fibers {
condition::condition() :
splk_(),
waiting_()
{}
@@ -33,12 +32,10 @@ condition::notify_one()
detail::notify::ptr_t n;
// get one waiting fiber
unique_lock< detail::spinlock > lk( splk_);
if ( ! waiting_.empty() ) {
n.swap( waiting_.front() );
waiting_.pop_front();
}
lk.unlock();
// notify waiting fiber
if ( n)
@@ -51,9 +48,7 @@ condition::notify_all()
std::deque< detail::notify::ptr_t > waiting;
// get all waiting fibers
unique_lock< detail::spinlock > lk( splk_);
waiting.swap( waiting_);
lk.unlock();
// notify all waiting fibers
while ( ! waiting.empty() )