pitrou commented on a change in pull request #8680:
URL: https://github.com/apache/arrow/pull/8680#discussion_r534358168



##########
File path: cpp/src/arrow/util/future.cc
##########
@@ -243,6 +253,12 @@ class ConcreteFutureImpl : public FutureImpl {
       }
     }
     cv_.notify_all();
+
+    // run callbacks
+    for (auto&& callback : callbacks_) {

Review comment:
       Because you're accessing an object that's mutated (potentially) from 
another thread in `AddCallback`.
   Ideally there should be a multi-threaded stress test for adding callbacks to 
a future.




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


Reply via email to