]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/interruptible_future: add ready|exception_future_marker constructors
authorSamuel Just <sjust@redhat.com>
Mon, 7 Jun 2021 20:20:46 +0000 (13:20 -0700)
committerSamuel Just <sjust@redhat.com>
Wed, 23 Jun 2021 18:26:39 +0000 (11:26 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/common/interruptible_future.h

index f4e5a85570e3dbea3d7ac5c7ec7f4e555714f13f..d05598fe6ad95cec1a85d0b43a78e4a31e069b96 100644 (file)
@@ -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,
@@ -582,6 +580,21 @@ public:
     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]]