hpx/collectives/latch.hpp
hpx/collectives/latch.hpp#
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace hpx
-
namespace distributed
-
class latch : public components::client_base<latch, hpx::lcos::server::latch>#
Public Functions
-
latch() = default#
-
explicit latch(std::ptrdiff_t count)#
Initialize the latch
Requires: count >= 0. Synchronization: None Postconditions: counter_ == count.
-
inline latch(hpx::id_type const &id)#
Extension: Create a client side representation for the existing server::latch instance with the given global id id.
-
inline latch(hpx::future<hpx::id_type> &&f)#
Extension: Create a client side representation for the existing server::latch instance with the given global id id.
Extension: Create a client side representation for the existing server::latch instance with the given global id id.
-
inline void count_down_and_wait()#
Decrements counter_ by 1 . Blocks at the synchronization point until counter_ reaches 0.
Requires: counter_ > 0.
Synchronization: Synchronizes with all calls that block on this latch and with all is_ready calls on this latch that return true.
- Throws
Nothing. –
-
inline void arrive_and_wait()#
Decrements counter_ by update . Blocks at the synchronization point until counter_ reaches 0.
Requires: counter_ > 0.
Synchronization: Synchronizes with all calls that block on this latch and with all is_ready calls on this latch that return true.
- Throws
Nothing. –
-
inline void count_down(std::ptrdiff_t n)#
Decrements counter_ by n. Does not block.
Requires: counter_ >= n and n >= 0.
Synchronization: Synchronizes with all calls that block on this latch and with all is_ready calls on this latch that return true .
- Throws
Nothing. –
-
inline bool is_ready() const noexcept#
Returns: counter_ == 0. Does not block.
- Throws
Nothing. –
-
inline bool try_wait() const noexcept#
Returns: counter_ == 0. Does not block.
- Throws
Nothing. –
-
inline void wait() const#
If counter_ is 0, returns immediately. Otherwise, blocks the calling thread at the synchronization point until counter_ reaches 0.
- Throws
Nothing. –
Private Types
-
typedef components::client_base<latch, hpx::lcos::server::latch> base_type#
-
latch() = default#
-
class latch : public components::client_base<latch, hpx::lcos::server::latch>#
-
namespace lcos
-
namespace distributed