paleolimbot commented on code in PR #12323: URL: https://github.com/apache/arrow/pull/12323#discussion_r848530032
########## r/src/csv.cpp: ########## @@ -162,7 +164,19 @@ std::shared_ptr<arrow::csv::TableReader> csv___TableReader__Make( // [[arrow::export]] std::shared_ptr<arrow::Table> csv___TableReader__Read( const std::shared_ptr<arrow::csv::TableReader>& table_reader) { - return ValueOrStop(table_reader->Read()); + std::thread* thread_ptr; + auto result = RunWithCapturedR<std::shared_ptr<arrow::Table>>([&]() { + auto fut = arrow::Future<std::shared_ptr<arrow::Table>>::Make(); + + thread_ptr = new std::thread([&] { fut.MarkFinished(table_reader->Read()); }); + + return fut; + }); + + thread_ptr->join(); + delete thread_ptr; + + return ValueOrStop(result); } Review Comment: This collapses things down nicely! -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org