MCPcopy Create free account
hub / github.com/apache/arrow / MarkFinalError

Method MarkFinalError

cpp/src/arrow/util/async_generator.h:1207–1219  ·  view source on GitHub ↗

This is called outside the mutex but it is only ever called once and Future<>::AddCallback is thread-safe

Source from the content-addressed store, hash-verified

1205 // This is called outside the mutex but it is only ever called
1206 // once and Future<>::AddCallback is thread-safe
1207 void MarkFinalError(const Status& err, Future<T> maybe_sink) {
1208 if (maybe_sink.is_valid()) {
1209 // Someone is waiting for this error so lets mark it complete when
1210 // all the work is done
1211 all_finished.AddCallback([maybe_sink, err](const Status& status) mutable {
1212 maybe_sink.MarkFinished(err);
1213 });
1214 } else {
1215 // No one is waiting for this error right now so it will be delivered
1216 // next.
1217 final_error = err;
1218 }
1219 }
1220
1221 bool IsCompleteUnlocked(const util::Mutex::Guard& guard) {
1222 return outstanding_requests == 0 &&

Callers 2

operator()Method · 0.80
operator()Method · 0.80

Calls 3

is_validMethod · 0.45
AddCallbackMethod · 0.45
MarkFinishedMethod · 0.45

Tested by

no test coverage detected