diff options
author | Spencer T Brody <spencer@mongodb.com> | 2020-04-08 21:24:21 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-04-09 22:20:47 +0000 |
commit | 0651f3c7b63130842e85d44fec624b82a33b67a3 (patch) | |
tree | 70346c5cfbf2b80ab422f713457983cd31f48ed4 /src/mongo/util/future.h | |
parent | b0e3eed55a031a43ddc9674c71da7c3e5e59eb64 (diff) | |
download | mongo-0651f3c7b63130842e85d44fec624b82a33b67a3.tar.gz |
SERVER-43442 Remove blocking call from AsyncWorkScheduler host targetting
Also updates some places relying on implicit conversion from Status to Future
to be explicit.
Diffstat (limited to 'src/mongo/util/future.h')
-rw-r--r-- | src/mongo/util/future.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/util/future.h b/src/mongo/util/future.h index 29ec737e8cc..89c97fa3d42 100644 --- a/src/mongo/util/future.h +++ b/src/mongo/util/future.h @@ -797,6 +797,15 @@ public: }); } + /** + * Same as setFrom(Future) above, but takes a SemiFuture instead of a Future. + */ + void setFrom(SemiFuture<T>&& future) noexcept { + setImpl([&](boost::intrusive_ptr<future_details::SharedState<T>>&& sharedState) { + std::move(future).propagateResultTo(sharedState.get()); + }); + } + TEMPLATE(typename... Args) REQUIRES(std::is_constructible_v<T, Args...> || (std::is_void_v<T> && sizeof...(Args) == 0)) void emplaceValue(Args&&... args) noexcept { |