Skip to content

Commit

Permalink
Fix distributed latch documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitraka committed May 21, 2024
1 parent 404e3c8 commit a7db072
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 109 deletions.
40 changes: 20 additions & 20 deletions docs/sphinx/api/public_distributed_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,23 @@ Classes
| :cpp:class:`hpx::distributed::latch` |
+--------------------------------------+

Functions
---------

.. table:: `hpx` functions of header ``hpx/latch.hpp``

+---------------------------------------------------+
| Function |
+===================================================+
| :cpp:func:`hpx::distributed::count_down_and_wait` |
+---------------------------------------------------+
| :cpp:func:`hpx::distributed::arrive_and_wait` |
+---------------------------------------------------+
| :cpp:func:`hpx::distributed::count_down` |
+---------------------------------------------------+
| :cpp:func:`hpx::distributed::is_ready` |
+---------------------------------------------------+
| :cpp:func:`hpx::distributed::try_wait` |
+---------------------------------------------------+
| :cpp:func:`hpx::distributed::wait` |
+---------------------------------------------------+
Member functions
^^^^^^^^^^^^^^^^

.. table:: `hpx` functions of class :cpp:class:`hpx::distributed::latch` from header ``hpx/latch.hpp``

+----------------------------------------------------------+
| Function |
+==========================================================+
| :cpp:func:`hpx::distributed::latch::count_down_and_wait` |
+----------------------------------------------------------+
| :cpp:func:`hpx::distributed::latch::arrive_and_wait` |
+----------------------------------------------------------+
| :cpp:func:`hpx::distributed::latch::count_down` |
+----------------------------------------------------------+
| :cpp:func:`hpx::distributed::latch::is_ready` |
+----------------------------------------------------------+
| :cpp:func:`hpx::distributed::latch::try_wait` |
+----------------------------------------------------------+
| :cpp:func:`hpx::distributed::latch::wait` |
+----------------------------------------------------------+
89 changes: 0 additions & 89 deletions libs/full/collectives/include/hpx/collectives/latch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,93 +10,6 @@

#pragma once

#if defined(DOXYGEN)
// clang-format off
namespace hpx { namespace distributed {

/// Latch is an implementation of a synchronization primitive that allows
/// multiple threads to wait for a shared event to occur before proceeding.
/// This latch can be invoked in a distributed application.
///
/// For a local only latch \see hpx::latch.
class HPX_EXPORT latch;

/// Initialize the latch
///
/// Requires: count >= 0.
/// Synchronization: None
/// Postconditions: counter_ == count.
///
explicit latch(std::ptrdiff_t count);

/// Extension: Create a client side representation for the existing
/// \a server#latch instance with the given global id \a id.
latch(hpx::id_type const& id);

/// Extension: Create a client side representation for the existing
/// \a server#latch instance with the given global id \a id.
latch(hpx::future<hpx::id_type>&& f);

/// Extension: Create a client side representation for the existing
/// \a server#latch instance with the given global id \a id.
latch(hpx::shared_future<hpx::id_type> const& id);

/// 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.
void count_down_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.
void arrive_and_wait();

/// 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.
void count_down(std::ptrdiff_t n);

/// Returns: counter_ == 0. Does not block.
///
/// \throws Nothing.
bool is_ready() const noexcept;

/// Returns: counter_ == 0. Does not block.
///
/// \throws Nothing.
///
bool try_wait() const noexcept;

/// If counter_ is 0, returns immediately. Otherwise, blocks the
/// calling thread at the synchronization point until counter_
/// reaches 0.
///
/// \throws Nothing.
///
void wait() const;

}} // namespace hpx::distributed

// clang-format on
#else

#include <hpx/config.hpp>
#include <hpx/collectives/detail/latch.hpp>
#include <hpx/components/client_base.hpp>
Expand Down Expand Up @@ -257,5 +170,3 @@ namespace hpx::lcos {
} // namespace hpx::lcos

#include <hpx/config/warnings_suffix.hpp>

#endif // DOXYGEN

0 comments on commit a7db072

Please sign in to comment.