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

Method WaitForEndOrUnlocked

cpp/src/arrow/testing/gtest_util.cc:1163–1185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1161 }
1162
1163 void WaitForEndOrUnlocked(std::chrono::time_point<std::chrono::steady_clock> end_time,
1164 arrow::internal::Executor* executor, Future<> future) {
1165 if (unlocked_) {
1166 num_finished_++;
1167 future.MarkFinished(Status::OK());
1168 return;
1169 }
1170 if (std::chrono::steady_clock::now() > end_time) {
1171 num_finished_++;
1172 future.MarkFinished(
1173 Status::Invalid("Task unlock never happened - if threads are disabled you "
1174 "can't wait on gatedtask"));
1175 return;
1176 }
1177
1178 SleepABit();
1179 auto spawn_status = executor->Spawn([this, end_time, executor, future]() {
1180 WaitForEndOrUnlocked(end_time, executor, future);
1181 });
1182 if (!spawn_status.ok()) {
1183 status_ &= Status::Invalid("Couldn't spawn gating task unlock waiter");
1184 }
1185 }
1186
1187 Future<> RunTaskFuture() {
1188 num_running_++;

Callers

nothing calls this directly

Calls 5

SleepABitFunction · 0.85
OKFunction · 0.50
InvalidFunction · 0.50
MarkFinishedMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected