void wait() { boost::fibers::mutex::scoped_lock l(m); while(!flag) { cond.wait(l); } }
void wait_fn( boost::fibers::mutex & mtx, boost::fibers::condition & cond) { boost::fibers::mutex::scoped_lock lk( mtx); cond.wait( lk); ++value; }
count_type wait() { all_futures_lock lk(futures); for(;;) { for(count_type i=0;i<futures.size();++i) { if(futures[i].future->done) { return futures[i].index; } } cv.wait(lk); } }
void signal() { boost::fibers::mutex::scoped_lock l(m); flag=true; cond.notify_all(); }
void notify_all_fn( boost::fibers::condition & cond) { cond.notify_all(); }
void notify_one_fn( boost::fibers::condition & cond) { cond.notify_one(); }