bkietz commented on a change in pull request #8680:
URL: https://github.com/apache/arrow/pull/8680#discussion_r534351495
##########
File path: cpp/src/arrow/util/future.cc
##########
@@ -229,6 +229,16 @@ class ConcreteFutureImpl : public FutureImpl {
void DoMarkFailed() { DoMarkFinishedOrFailed(FutureState::FAILURE); }
+ void AddCallback(Callback callback) {
+ std::unique_lock<std::mutex> lock(mutex_);
+ if (IsFutureFinished(state_)) {
+ lock.unlock();
+ std::move(callback)();
Review comment:
I don't think so; we don't provide guarantees on callback ordering. I'll
add a comment to that effect
----------------------------------------------------------------
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]