adamdebreceni commented on a change in pull request #1022:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1022#discussion_r589250748
##########
File path: libminifi/test/unit/ThreadPoolTests.cpp
##########
@@ -70,8 +70,7 @@ TEST_CASE("ThreadPoolTest1", "[TPT1]") {
std::function<bool()> f_ex = function;
utils::Worker<bool> functor(f_ex, "id");
pool.start();
- std::future<bool> fut;
- REQUIRE(true == pool.execute(std::move(functor), fut));
+ auto fut = pool.execute(std::move(functor));
fut.wait();
Review comment:
a default constructed future and a future that has been moved from are
also `valid() == false`, my only problem is that operating on an "invalid"
future is undefined behavior (although encouraged to throw), but I believe we
can safely assume that `ThreadPool<T>::execute` returns a valid future, in
which case I would remove the validity checks from `SchedulingAgent.cpp`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]