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

Method DoWait

cpp/src/arrow/util/future.cc:152–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150 }
151
152 void DoWait() {
153#ifdef ARROW_ENABLE_THREADING
154 std::unique_lock<std::mutex> lock(mutex_);
155
156 cv_.wait(lock, [this] { return IsFutureFinished(state_); });
157#else
158 auto last_processed_time = std::chrono::steady_clock::now();
159 while (true) {
160 if (IsFutureFinished(state_)) {
161 return;
162 }
163 if (arrow::internal::SerialExecutor::RunTasksOnAllExecutors() == false) {
164 auto this_time = std::chrono::steady_clock::now();
165 if (this_time - last_processed_time < std::chrono::seconds(10)) {
166 ARROW_LOG(WARNING) << "Waiting for future, but no executors have had any tasks "
167 "pending for last 10 seconds";
168 last_processed_time = std::chrono::steady_clock::now();
169 }
170 }
171 }
172#endif
173 }
174
175 bool DoWait(double seconds) {
176#ifdef ARROW_ENABLE_THREADING

Callers 1

WaitMethod · 0.80

Calls 1

IsFutureFinishedFunction · 0.85

Tested by

no test coverage detected