Standardbibliotheks-Header <latch> (C++20)
Von cppreference.com
Dieser Header ist Teil der Thread-Unterstützungs-Bibliothek.
Klassen | |
| (C++20) |
einmalig verwendbare Thread-Barriere (Klasse) |
[bearbeiten] Synopsis
namespace std { class latch; }
[bearbeiten] Klasse std::latch
namespace std { class latch { public: static constexpr ptrdiff_t max() noexcept; constexpr explicit latch(ptrdiff_t expected); ~latch(); latch(const latch&) = delete; latch& operator=(const latch&) = delete; void count_down(ptrdiff_t update = 1); bool try_wait() const noexcept; void wait() const; void arrive_and_wait(ptrdiff_t update = 1); private: ptrdiff_t counter; // exposition only }; }