You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, exceptions are handle inline (without creating new promises). This can cause a stack overflow when there are long chains of futures. They could instead be passed off to the executor which appears to help if it is an async one (but I guess the problem would still be there in the case of an immediate executor).
diff --git a/ThirdParty/stlab/concurrency/future.hpp b/ThirdParty/stlab/concurrency/future.hpp
index c0ec59397..d92667fd9 100644
--- a/ThirdParty/stlab/concurrency/future.hpp
+++ b/ThirdParty/stlab/concurrency/future.hpp
@@ -288,7 +288,7 @@ struct shared_base<T, enable_if_copyable<T>> : std::enable_shared_from_this<shar
_ready = true;
}
// propagate exception without scheduling
- for (const auto& e : then) { e.second(); }
+ for (const auto& e : then) { _executor(e.second); }
}
template <typename F, typename... Args>
@@ -456,8 +456,7 @@ struct shared_base<void> : std::enable_shared_from_this<shared_base<void>> {
then = std::move(_then);
_ready = true;
}
- // propagate exception without scheduling
- for (const auto& e : then) { e.second(); }
+ for (const auto& e : then) { _executor(e.second); }
}
auto get_try() -> bool {
The text was updated successfully, but these errors were encountered:
Currently, exceptions are handle inline (without creating new promises). This can cause a stack overflow when there are long chains of futures. They could instead be passed off to the executor which appears to help if it is an async one (but I guess the problem would still be there in the case of an immediate executor).
The text was updated successfully, but these errors were encountered: