Skip to content

Commit

Permalink
Minor changes to how actions are executed. This mostly improves consi…
Browse files Browse the repository at this point in the history
…stency of different APIs.
  • Loading branch information
hkaiser committed Feb 22, 2018
1 parent 6fbd8e1 commit 99ea636
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions hpx/runtime/actions/basic_action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ namespace hpx { namespace actions
std::is_void<R>::value, util::unused_type, R
>::type
result_type;

template <typename ...Ts>
HPX_FORCEINLINE result_type operator()(
naming::address::address_type lva,
Expand All @@ -205,6 +206,7 @@ namespace hpx { namespace actions
std::forward<Ts>(vs)...);
}

private:
template <typename ...Ts>
HPX_FORCEINLINE result_type invoke(std::true_type,
naming::address::address_type lva,
Expand Down Expand Up @@ -291,7 +293,8 @@ namespace hpx { namespace actions
naming::address::address_type lva,
naming::address::component_type comptype, Ts&&... vs)
{
if (target && target.get_management_type() == naming::id_type::unmanaged)
if (target &&
target.get_management_type() == naming::id_type::unmanaged)
{
return traits::action_decorate_function<Derived>::call(lva,
util::bind(util::one_shot(
Expand Down Expand Up @@ -320,7 +323,8 @@ namespace hpx { namespace actions
naming::address::component_type&, Ts&&...
> thread_function;

if (target && target.get_management_type() == naming::id_type::unmanaged)
if (target &&
target.get_management_type() == naming::id_type::unmanaged)
{
return traits::action_decorate_function<Derived>::call(lva,
thread_function(std::move(cont), lva, invoker(),
Expand Down Expand Up @@ -384,7 +388,7 @@ namespace hpx { namespace actions
Ts&&... vs) const
{
return sync_invoke::call(
launch::sync, id, throws, std::forward<Ts>(vs)...);
policy, id, throws, std::forward<Ts>(vs)...);
}

template <typename ...Ts>
Expand Down Expand Up @@ -418,8 +422,8 @@ namespace hpx { namespace actions
operator()(DistPolicy const& dist_policy, error_code& ec,
Ts&&... vs) const
{
return (*this)(launch::sync, dist_policy, ec,
std::forward<Ts>(vs)...);
return sync_invoke::call(
launch::sync, dist_policy, ec, std::forward<Ts>(vs)...);
}

template <typename DistPolicy, typename ...Ts>
Expand All @@ -431,8 +435,8 @@ namespace hpx { namespace actions
operator()(launch policy,
DistPolicy const& dist_policy, Ts&&... vs) const
{
return (*this)(launch::sync, dist_policy, throws,
std::forward<Ts>(vs)...);
return sync_invoke::call(
policy, dist_policy, throws, std::forward<Ts>(vs)...);
}

template <typename DistPolicy, typename ...Ts>
Expand All @@ -443,8 +447,8 @@ namespace hpx { namespace actions
>::type
operator()(DistPolicy const& dist_policy, Ts&&... vs) const
{
return (*this)(launch::sync, dist_policy, throws,
std::forward<Ts>(vs)...);
return sync_invoke::call(
launch::sync, dist_policy, throws, std::forward<Ts>(vs)...);
}

///////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 99ea636

Please sign in to comment.