標準庫標頭檔案 <barrier> (C++20)
來自 cppreference.com
此標頭檔案是 執行緒支援 庫的一部分。
類 | |
(C++20) |
可重用執行緒屏障 (類模板) |
[編輯] 概要
namespace std { template<class CompletionFunction = /* see description */> class barrier; }
[編輯] 類模板 std::barrier
namespace std { template<class CompletionFunction = /* see description */> class barrier { public: using arrival_token = /* see description */; 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; // exposition only }; }