hpx/components_base/server/locking_hook.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace components
template<typename BaseComponent, typename Mutex = hpx::spinlock>
struct locking_hook : public BaseComponent
#include <locking_hook.hpp>

This hook can be inserted into the derivation chain of any component allowing to automatically lock all action invocations for any instance of the given component.

Public Types

template<>
using decorates_action = void

Public Functions

locking_hook()
template<typename T, typename ...Ts, typename Enable = std::enable_if_t<!std::is_same_v<std::decay_t<T>, locking_hook>>>
locking_hook(T &&t, Ts&&... ts)
locking_hook(locking_hook const &rhs)
locking_hook(locking_hook &&rhs)
locking_hook &operator=(locking_hook const &rhs)
locking_hook &operator=(locking_hook &&rhs)

Public Static Functions

template<typename F>
static threads::thread_function_type decorate_action(naming::address_type lva, F &&f)

Protected Types

template<>
using yield_decorator_type = hpx::function<threads::thread_arg_type(threads::thread_result_type)>

Protected Functions

threads::thread_result_type thread_function(threads::thread_function_type f, threads::thread_arg_type state)
threads::thread_arg_type yield_function(threads::thread_result_type state)

Private Types

template<>
using mutex_type = Mutex
template<>
using base_type = BaseComponent
template<>
using this_component_type = typename base_type::this_component_type

Private Members

mutex_type mtx_
struct decorate_wrapper

Public Functions

template<typename F, typename Enable = std::enable_if_t<!std::is_same_v<std::decay_t<F>, decorate_wrapper>>>
decorate_wrapper(F &&f)
template<>
~decorate_wrapper()
struct undecorate_wrapper

Public Functions

template<>
undecorate_wrapper()
template<>
~undecorate_wrapper()

Public Members

template<>
yield_decorator_type yield_decorator_