Skip to content

Commit

Permalink
crimson/common/interruptible_future: add ready|exception_future_marke…
Browse files Browse the repository at this point in the history
…r constructors

Signed-off-by: Samuel Just <[email protected]>
  • Loading branch information
athanatos committed Jun 23, 2021
1 parent c89142b commit 06c6377
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/crimson/common/interruptible_future.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,6 @@ struct interruptible_errorator {
}

using pass_further = typename Errorator::pass_further;
using ready_future_marker = ready_future_marker;
using exception_future_marker = exception_future_marker;
};

template <typename InterruptCond,
Expand Down Expand Up @@ -582,6 +580,21 @@ class [[nodiscard]] interruptible_future_detail<
interruptible_future_detail<InterruptCond, seastar::future<T>>&& fut)
: core_type(static_cast<seastar::future<T>&&>(fut)) {}

template <class... A>
[[gnu::always_inline]]
interruptible_future_detail(ready_future_marker, A&&... a)
: core_type(::seastar::make_ready_future<typename core_type::value_type>(
std::forward<A>(a)...)) {
}
[[gnu::always_inline]]
interruptible_future_detail(exception_future_marker, ::seastar::future_state_base&& state) noexcept
: core_type(::seastar::futurize<core_type>::make_exception_future(std::move(state))) {
}
[[gnu::always_inline]]
interruptible_future_detail(exception_future_marker, std::exception_ptr&& ep) noexcept
: core_type(::seastar::futurize<core_type>::make_exception_future(std::move(ep))) {
}

template<bool interruptible = true, typename ValueInterruptCondT, typename ErrorVisitorT,
std::enable_if_t<!interruptible, int> = 0>
[[gnu::always_inline]]
Expand Down

0 comments on commit 06c6377

Please sign in to comment.