bkietz commented on a change in pull request #9134:
URL: https://github.com/apache/arrow/pull/9134#discussion_r554077313



##########
File path: cpp/src/arrow/util/thread_pool.cc
##########
@@ -84,10 +84,10 @@ static void WorkerLoop(std::shared_ptr<ThreadPool::State> 
state,
         break;
       }
       {
-        std::function<void()> task = std::move(state->pending_tasks_.front());
+        FnOnce<void()> task = std::move(state->pending_tasks_.front());
         state->pending_tasks_.pop_front();
         lock.unlock();
-        task();
+        std::move(task)();
       }

Review comment:
       since invoking task will drop its resources, we no longer need to wrap 
it in an explicit scope
   




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