Skip to content

Commit

Permalink
#702: add documentation to MergedClosure and mergeChainStep
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Aug 25, 2020
1 parent fd8a0e1 commit 71ff4f6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/vt/messaging/dependent_send_chain.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,17 @@ struct PendingClosure {
PendingSend pending_; /**< The \c PendingSend to be released */
};

/**
* \struct MergedClosure dependent_send_chain.h vt/messaging/dependent_send_chain.h
*
* \brief A copyable closure that holds a \c PendingSend that will be released
* when all shared instances of this closure are destroyed.
*/
struct MergedClosure {
/**
* \brief Construct from a shared pointer to a \c PendingSend
* \param[in] shared_state the \c PendingSend that will be released
*/
explicit MergedClosure(std::shared_ptr<PendingSend> shared_state)
: shared_state_(shared_state)
{}
Expand Down Expand Up @@ -131,6 +141,14 @@ class DependentSendChain final {
last_epoch_ = new_epoch;
}

/**
* \brief Add a task that is dependent on two DependentSendChain instances
*
* \param[in] a the first DependentSendChain
* \param[in] b the second DependentSendChain
* \param[in] new_epoch the epoch the task is being added to
* \param[in] link the \c PendingSend to release when complete
*/
static void mergeChainStep(DependentSendChain &a, DependentSendChain &b,
EpochType new_epoch, PendingSend&& link) {
a.checkInit();
Expand Down

0 comments on commit 71ff4f6

Please sign in to comment.