westonpace commented on a change in pull request #9892:
URL: https://github.com/apache/arrow/pull/9892#discussion_r609656816



##########
File path: cpp/src/arrow/util/thread_pool.h
##########
@@ -233,15 +233,7 @@ class ARROW_EXPORT SerialExecutor : public Executor {
     if (final_fut.is_finished()) {
       return final_fut.result();
     }
-    final_fut = final_fut.Then(
-        [this](const T& res) {
-          MarkFinished();
-          return res;
-        },
-        [this](const Status& st) -> Result<T> {
-          MarkFinished();
-          return st;
-        });
+    final_fut.AddCallback([this](const Result<T>&) { MarkFinished(); });

Review comment:
       Actually, I guess we can't return from `RunLoop` until `MarkFinished` 
has completed so `final_fut.result()` is always going to be called on a 
completed future either way.  Nevermind.  This should be ok.




-- 
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]


Reply via email to