westonpace commented on code in PR #13651:
URL: https://github.com/apache/arrow/pull/13651#discussion_r925697917


##########
cpp/src/arrow/compute/exec/source_node.cc:
##########
@@ -139,13 +147,18 @@ struct SourceNode : ExecNode {
                      options);
                })
                    .Then(
-                       [=](int total_batches) {
+                       [this, scan_task](int total_batches) mutable {
+                         std::unique_lock<std::mutex> lock(mutex_);
+                         bool should_mark_finished = !finished_.is_finished();
+                         lock.unlock();

Review Comment:
   Good catch.  This lock was obviously not needed and it turns out I could get 
rid of locking above too.  The code was perhaps a bit more paranoid than it 
needed to be.



##########
cpp/src/arrow/util/future.cc:
##########
@@ -339,8 +339,8 @@ class ConcreteFutureImpl : public FutureImpl {
       if (waiter_ != nullptr) {
         waiter_->MarkFutureFinishedUnlocked(waiter_arg_, state);
       }
+      cv_.notify_all();

Review Comment:
   Done.



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