Commit 2b4f07ee authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Use InlineExecutor singleton in Future wait

Summary:
[Folly] Use `InlineExecutor` singleton in `Future` wait v.s. letting the executor be `nullptr`.

The effect is the same, but just more explicit.

Reviewed By: marshallcline

Differential Revision: D8306902

fbshipit-source-id: fc90704de670b1ca9956253383fadad3be297847
parent fc75fc56
......@@ -1771,7 +1771,7 @@ namespace detail {
template <class FutureType, typename T = typename FutureType::value_type>
void waitImpl(FutureType& f) {
if (std::is_base_of<Future<T>, FutureType>::value) {
f = std::move(f).via(nullptr);
f = std::move(f).via(&InlineExecutor::instance());
}
// short-circuit if there's nothing to do
if (f.isReady()) {
......@@ -1800,7 +1800,7 @@ void convertFuture(SemiFuture<T>&& sf, SemiFuture<T>& f) {
template <class FutureType, typename T = typename FutureType::value_type>
void waitImpl(FutureType& f, Duration dur) {
if (std::is_base_of<Future<T>, FutureType>::value) {
f = std::move(f).via(nullptr);
f = std::move(f).via(&InlineExecutor::instance());
}
// short-circuit if there's nothing to do
if (f.isReady()) {
......@@ -1833,7 +1833,7 @@ void waitViaImpl(Future<T>& f, DrivableExecutor* e) {
e->drive();
}
assert(f.isReady());
f = std::move(f).via(nullptr);
f = std::move(f).via(&InlineExecutor::instance());
}
template <class T, typename Rep, typename Period>
......@@ -1858,7 +1858,7 @@ void waitViaImpl(
}
assert(f.isReady() || (now >= deadline));
if (f.isReady()) {
f = std::move(f).via(nullptr);
f = std::move(f).via(&InlineExecutor::instance());
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment