| 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_++; |
nothing calls this directly
no test coverage detected