31 #include <boost/atomic/atomic.hpp>
56 void wait_for_my_turn();
63 boost::atomic<future<void>*> latch;
80 template<
typename Functor1,
typename Functor2>
81 auto do_serial(
const Functor1& f1,
const Functor2& f2 ) -> decltype(f2())
85 guard.wait_for_my_turn();
97 template<
typename Functor>
99 typedef decltype(f()) Result;
100 typedef typename std::remove_const_t< std::remove_reference_t<Functor> > FunctorType;
101 typename task<Result,
sizeof(FunctorType)>::ptr tsk =
102 task<Result,
sizeof(FunctorType)>::create( std::forward<Functor>(f), desc );