Opened 9 years ago

Last modified 9 years ago

#8519 closed Feature Requests

Sync: Add a completion_latch class — at Initial Version

Reported by: viboes Owned by: Anthony Williams
Milestone: Boost 1.55.0 Component: thread
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

Based on the ideas in N3600- C++ Latches and Barriers http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3600.html

implement a completion_latch class that could have the following interface

    class completion_latch
    {
    public:
        typedef 'implementation defined' completion_function;

        completion_latch(completion_latch const&) = delete;
        completion_latch& operator=(completion_latch const&) = delete;

        completion_latch(std::size_t count);
        template <typename F>
        completion_latch(std::size_t count, F&& funct);
        ~completion_latch();

        void wait();
        bool try_wait();
        template <class Rep, class Period>
        cv_status wait_for(const chrono::duration<Rep, Period>& rel_time);
        template <class lock_type, class Clock, class Duration>
        cv_status wait_until(const chrono::time_point<Clock, Duration>& abs_time);
        void count_down();
        void count_down_and_wait();
        void reset(std::size_t count);
        template <typename F>
        completion_function then(F&& funct);
    };

Change History (0)

Note: See TracTickets for help on using tickets.