westonpace commented on code in PR #40722:
URL: https://github.com/apache/arrow/pull/40722#discussion_r1549905399
##########
cpp/src/arrow/dataset/dataset_writer.cc:
##########
@@ -541,6 +541,23 @@ class DatasetWriter::DatasetWriterImpl {
}
}
+ void ResumeIfNeeded() {
+ if (!paused_) {
+ return;
+ }
+ bool needs_resume = false;
+ {
+ std::lock_guard lg(mutex_);
+ if (!write_tasks_ || write_tasks_->QueueSize() == 0) {
+ needs_resume = true;
+ }
+ }
+ if (needs_resume) {
+ paused_ = false;
Review Comment:
All access to `paused_` is done from a single "logical thread".
`write_tasks_` is a scheduler with max capacity of 1 and so the items submitted
to it will never run in parallel (though they may be run on different OS
threads).
--
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]