Changes between Initial Version and Version 2 of Ticket #8519


Ignore:
Timestamp:
Jun 16, 2013, 4:20:41 PM (9 years ago)
Author:
viboes
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8519

    • Property Owner changed from Anthony Williams to viboes
    • Property Status newassigned
    • Property Summary Sync: Add a completion_latch classSynchro: Update class barrier with a completion function
  • Ticket #8519 – Description

    initial v2  
    11Based on the ideas in N3600- C++ Latches and Barriers  http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3600.html
    22
    3 implement a completion_latch class that could have the following interface
     3add a completion function associated to the class barrier
    44
    55
    66{{{
    7     class completion_latch
     7    class barrier
    88    {
    99    public:
    10         typedef 'implementation defined' completion_function;
     10        barrier(barrier const&) = delete;
     11        barrier& operator=(barrier const&) = delete;
    1112
    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&&);
    1416
    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();
    1918
    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();
    2720        void count_down_and_wait();
    28         void reset(std::size_t count);
    29         template <typename F>
    30         completion_function then(F&& funct);
    3121    };
    3222
     23
    3324}}}