dam4rus commented on a change in pull request #1022:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1022#discussion_r589318656
##########
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:
Sorry for the confusing comment. I meant that in this case `valid` would
be only `false` after calling `get`/`share`. If I get this right,
`std::promise::get_future` can't return an invalid `std::future` since it
throws an exception when called on an invalid `std::promise`. E.g. it has no
state or `get_future` has already been called once.
I'm not super familiar with `std::promise` to be honest but I think it's
safe to remove validity checks in these cases. Wouldn't an invalid
`std::future` would have cause problems by now?
----------------------------------------------------------------
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]