Changes between Initial Version and Version 2 of Ticket #8519
- Timestamp:
- Jun 16, 2013, 4:20:41 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #8519
- Property Owner changed from to
- Property Status new → assigned
- Property Summary Sync: Add a completion_latch class → Synchro: Update class barrier with a completion function
-
Ticket #8519 – Description
initial v2 1 1 Based on the ideas in N3600- C++ Latches and Barriers http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3600.html 2 2 3 implement a completion_latch class that could have the following interface 3 add a completion function associated to the class barrier 4 4 5 5 6 6 {{{ 7 class completion_latch7 class barrier 8 8 { 9 9 public: 10 typedef 'implementation defined' completion_function; 10 barrier(barrier const&) = delete; 11 barrier& operator=(barrier const&) = delete; 11 12 12 completion_latch(completion_latch const&) = delete; 13 completion_latch& operator=(completion_latch const&) = delete; 13 barrier(unsigned int count); 14 template <typename F> 15 barrier(unsigned int count, F&&); 14 16 15 completion_latch(std::size_t count); 16 template <typename F> 17 completion_latch(std::size_t count, F&& funct); 18 ~completion_latch(); 17 ~barrier(); 19 18 20 void wait(); 21 bool try_wait(); 22 template <class Rep, class Period> 23 cv_status wait_for(const chrono::duration<Rep, Period>& rel_time); 24 template <class lock_type, class Clock, class Duration> 25 cv_status wait_until(const chrono::time_point<Clock, Duration>& abs_time); 26 void count_down(); 19 bool wait(); 27 20 void count_down_and_wait(); 28 void reset(std::size_t count);29 template <typename F>30 completion_function then(F&& funct);31 21 }; 32 22 23 33 24 }}}