bkietz commented on a change in pull request #8680:
URL: https://github.com/apache/arrow/pull/8680#discussion_r534352606
##########
File path: cpp/src/arrow/util/task_group.h
##########
@@ -22,22 +22,33 @@
#include <utility>
#include "arrow/status.h"
+#include "arrow/util/future.h"
Review comment:
will remove
##########
File path: cpp/src/arrow/util/task_group.cc
##########
@@ -91,14 +81,17 @@ class ThreadedTaskGroup : public TaskGroup {
nremaining_.fetch_add(1, std::memory_order_acquire);
auto self = checked_pointer_cast<ThreadedTaskGroup>(shared_from_this());
- Status st = executor_->Spawn([self, task]() {
- if (self->ok_.load(std::memory_order_acquire)) {
- // XXX what about exceptions?
- Status st = task();
- self->UpdateStatus(std::move(st));
- }
- self->OneTaskDone();
- });
+ Status st = executor_->Spawn(std::bind(
+ [](const std::shared_ptr<ThreadedTaskGroup>& self,
+ const std::function<Status()>& task) {
+ if (self->ok_.load(std::memory_order_acquire)) {
+ // XXX what about exceptions?
+ Status st = task();
+ self->UpdateStatus(std::move(st));
+ }
+ self->OneTaskDone();
+ },
+ std::move(self), std::move(task)));
Review comment:
indeed
----------------------------------------------------------------
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]