Namespaces
Variants

Standard library header <barrier> (C++20)

From cppreference.net
Standard library headers

このヘッダは スレッドサポート ライブラリの一部です。

Classes

(C++20)
再利用可能なスレッドバリア
(クラステンプレート)

概要

namespace std {
  template<class CompletionFunction = /* 詳細は説明を参照 */>
    class barrier;
}

クラステンプレート std::barrier

namespace std {
  template<class CompletionFunction = /* 説明を参照 */>
  class barrier {
  public:
    using arrival_token =  /* 説明を参照 */;
    static constexpr ptrdiff_t max() noexcept;
    constexpr explicit barrier(ptrdiff_t expected,
                               CompletionFunction f = CompletionFunction());
    ~barrier();
    barrier(const barrier&) = delete;
    barrier& operator=(const barrier&) = delete;
    arrival_token arrive(ptrdiff_t update = 1);
    void wait(arrival_token&& arrival) const;
    void arrive_and_wait();
    void arrive_and_drop();
  private:
    CompletionFunction completion;      // 説明専用
  };
}