9 May
2013
9 May
'13
6:33 a.m.
Just came across http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3600.html C++ Latches and Barriers Synopsis The synopsis is as follows. class latch { public: explicit latch(size_t count); ~latch(); void count_down(); void wait(); bool try_wait(); void count_down_and_wait(); }; class barrier { public: explicit barrier(size_t num_threads) throw (std::invalid_argument); explicit barrier(size_t num_threads, std::function<void()> f) throw (std::invalid_argument); ~barrier(); void count_down_and_wait(); void reset(size_t num_threads); void reset(function f); };