hpx/synchronization/async_rw_mutex.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
experimental
-
template<typename
ReadWriteT
, typenameReadT
, typenameAllocator
>
classasync_rw_mutex
¶ - #include <async_rw_mutex.hpp>
Read-write mutex where access is granted to a value through senders.
The wrapped value is accessed through read and readwrite, both of which return senders which call set_value on a connected receiver when the wrapped value is safe to read or write. The senders send the value through a wrapper type which is implicitly convertible to a reference of the wrapped value. Read-only senders send wrappers that are convertible to const references.
A read-write sender gives exclusive access to the wrapped value, while a read-only sender gives shared (with other read-only senders) access to the value.
A void mutex acts as a mutex around some user-managed resource, i.e. the void mutex does not manage any value and the types sent by the senders are not convertible. The sent types are copyable and release access to the protected resource when released.
The order in which senders call set_value is determined by the order in which the senders are retrieved from the mutex. Connecting and starting the senders is thread-safe.
Retrieving senders from the mutex is not thread-safe.
The mutex is movable and non-copyable.
Public Types
-
template<>
usingvalue_type
= readwrite_type¶
-
template<>
usingread_access_type
= detail::async_rw_mutex_access_wrapper<readwrite_type, read_type, detail::async_rw_mutex_access_type::read>¶
-
template<>
usingreadwrite_access_type
= detail::async_rw_mutex_access_wrapper<readwrite_type, read_type, detail::async_rw_mutex_access_type::readwrite>¶
-
template<>
usingallocator_type
= Allocator¶
Public Functions
-
async_rw_mutex
()¶
-
template<typename
U
, typename = std::enable_if_t<!std::is_same<std::decay_t<U>, async_rw_mutex>::value>>async_rw_mutex
(U &&u, allocator_type const &alloc = {})¶
-
async_rw_mutex
(async_rw_mutex&&)¶
-
async_rw_mutex &
operator=
(async_rw_mutex&&)¶
-
async_rw_mutex
(async_rw_mutex const&)¶
-
async_rw_mutex &
operator=
(async_rw_mutex const&)¶
-
sender<detail::async_rw_mutex_access_type::read>
read
()¶
-
sender<detail::async_rw_mutex_access_type::readwrite>
readwrite
()¶
Private Types
Private Members
-
value_type
value
¶
-
allocator_type
alloc
¶
-
detail::async_rw_mutex_access_type
prev_access
= detail::async_rw_mutex_access_type::readwrite¶
-
shared_state_ptr_type
prev_state
¶
-
shared_state_ptr_type
state
¶
-
template<detail::async_rw_mutex_access_type
AccessType
>
structsender
¶ Public Types
-
template<>
template<>
usingaccess_type
= detail::async_rw_mutex_access_wrapper<readwrite_type, read_type, AccessType>¶
Friends
-
template<typename
Env
>
autotag_invoke
(hpx::execution::experimental::get_completion_signatures_t, sender const&, Env)
-
template<typename
R
>
autotag_invoke
(hpx::execution::experimental::connect_t, sender &&s, R &&r)
-
template<typename
Env
>
structgenerate_completion_signatures
¶ Public Types
-
template<>
template<>
template<template<typename...> typenameTuple
, template<typename...> typenameVariant
>
usingvalue_types
= Variant<Tuple<access_type>>¶
Public Static Attributes
-
template<>
template<>
constexpr boolsends_stopped
= false¶
-
template<>
-
template<typename
R
>
structoperation_state
¶ Public Functions
-
template<>
template<>operation_state
(operation_state&&)¶
-
template<>
template<>
operation_state &operator=
(operation_state&&)¶
-
template<>
template<>operation_state
(operation_state const&)¶
-
template<>
template<>
operation_state &operator=
(operation_state const&)¶
Public Members
-
template<>
template<>
shared_state_ptr_typeprev_state
¶
-
template<>
template<>
shared_state_ptr_typestate
¶
Friends
-
void
tag_invoke
(hpx::execution::experimental::start_t, operation_state &os)
-
template<>
-
template<>
-
template<>
-
template<typename
Allocator
>
classasync_rw_mutex
<void, void, Allocator>¶ Public Types
-
template<>
usingread_type
= void¶
-
template<>
usingreadwrite_type
= void¶
-
template<>
usingread_access_type
= detail::async_rw_mutex_access_wrapper<readwrite_type, read_type, detail::async_rw_mutex_access_type::read>¶
-
template<>
usingreadwrite_access_type
= detail::async_rw_mutex_access_wrapper<readwrite_type, read_type, detail::async_rw_mutex_access_type::readwrite>¶
-
template<>
usingallocator_type
= Allocator¶
Public Functions
-
async_rw_mutex
(allocator_type const &alloc = {})¶
-
async_rw_mutex
(async_rw_mutex&&)
-
async_rw_mutex &
operator=
(async_rw_mutex&&)
-
async_rw_mutex
(async_rw_mutex const&)
-
async_rw_mutex &
operator=
(async_rw_mutex const&)
-
sender<detail::async_rw_mutex_access_type::read>
read
()
-
sender<detail::async_rw_mutex_access_type::readwrite>
readwrite
()
Private Types
Private Members
-
allocator_type
alloc
-
detail::async_rw_mutex_access_type
prev_access
= detail::async_rw_mutex_access_type::readwrite
-
shared_state_ptr_type
prev_state
-
shared_state_ptr_type
state
-
template<detail::async_rw_mutex_access_type
AccessType
>
structsender
¶ Public Types
-
template<>
template<>
usingaccess_type
= detail::async_rw_mutex_access_wrapper<readwrite_type, read_type, AccessType>¶
Friends
-
template<typename
Env
>
autotag_invoke
(hpx::execution::experimental::get_completion_signatures_t, sender const&, Env)
-
template<typename
R
>
autotag_invoke
(hpx::execution::experimental::connect_t, sender &&s, R &&r)
-
template<typename
Env
>
structgenerate_completion_signatures
¶ Public Types
-
template<>
template<>
template<template<typename...> typenameTuple
, template<typename...> typenameVariant
>
usingvalue_types
= Variant<Tuple<access_type>>¶
Public Static Attributes
-
template<>
template<>
constexpr boolsends_stopped
= false¶
-
template<>
-
template<typename
R
>
structoperation_state
¶ Public Functions
-
template<>
template<>operation_state
(operation_state&&)¶
-
template<>
template<>
operation_state &operator=
(operation_state&&)¶
-
template<>
template<>operation_state
(operation_state const&)¶
-
template<>
template<>
operation_state &operator=
(operation_state const&)¶
Public Members
-
template<>
template<>
shared_state_ptr_typeprev_state
¶
-
template<>
template<>
shared_state_ptr_typestate
¶
Friends
-
void
tag_invoke
(hpx::execution::experimental::start_t, operation_state &os)
-
template<>
-
template<>
-
template<>
-
template<typename
-
namespace