mapleFU commented on code in PR #45954:
URL: https://github.com/apache/arrow/pull/45954#discussion_r2017132055
##########
cpp/src/arrow/util/async_generator.h:
##########
@@ -800,16 +816,18 @@ class ReadaheadGenerator {
: source_generator(std::move(source_generator)),
max_readahead(max_readahead) {}
void MarkFinishedIfDone(const T& next_result) {
+ // ASSERT_HELD(mu)
if (IsIterationEnd(next_result)) {
- finished.store(true);
+ finished = true;
}
}
AsyncGenerator<T> source_generator;
int max_readahead;
Future<> final_future = Future<>::Make();
- std::atomic<int> num_running{0};
- std::atomic<bool> finished{false};
+ int num_running{0}; // GUARDED_BY(mu)
Review Comment:
This is just my code style, also related tool is
https://clang.llvm.org/docs/ThreadSafetyAnalysis.html , I just follow same
style here
--
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]