bkietz commented on code in PR #38466:
URL: https://github.com/apache/arrow/pull/38466#discussion_r1372437625


##########
cpp/src/arrow/csv/reader.cc:
##########
@@ -1112,15 +1112,16 @@ class AsyncThreadedTableReader
  protected:
   Future<std::shared_ptr<Buffer>> ProcessFirstBuffer() {
     // First block
+    auto self = shared_from_this();
     auto first_buffer_future = buffer_generator_();
-    return first_buffer_future.Then([this](const std::shared_ptr<Buffer>& 
first_buffer)
+    return first_buffer_future.Then([self](const std::shared_ptr<Buffer>& 
first_buffer)

Review Comment:
   ```suggestion
       return first_buffer_future.Then([self = shared_from_this()](const 
std::shared_ptr<Buffer>& first_buffer)
   ```



##########
cpp/src/parquet/arrow/reader.cc:
##########
@@ -1122,11 +1122,12 @@ class RowGroupGenerator {
     } else {
       auto ready = reader->parquet_reader()->WhenBuffered({row_group}, 
column_indices);
       if (cpu_executor_) ready = cpu_executor_->TransferAlways(ready);
+      auto cpu_executor = cpu_executor_;
       row_group_read =
-          ready.Then([this, reader, row_group,
+          ready.Then([cpu_executor, reader, row_group,

Review Comment:
   ```suggestion
             ready.Then([executor = cpu_executor_, reader, row_group,
   ```



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to