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

Method RunTask

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

Source from the content-addressed store, hash-verified

1210 }
1211
1212 void RunTask() {
1213#ifdef ARROW_ENABLE_THREADING
1214 std::unique_lock<std::mutex> lk(mx_);
1215 num_running_++;
1216 running_cv_.notify_all();
1217 if (!unlocked_cv_.wait_for(
1218 lk, std::chrono::nanoseconds(static_cast<int64_t>(timeout_seconds_ * 1e9)),
1219 [this] { return unlocked_; })) {
1220 status_ &= Status::Invalid("Timed out (" + std::to_string(timeout_seconds_) + "," +
1221 std::to_string(unlocked_) +
1222 " seconds) waiting for the gating task to be unlocked");
1223 }
1224 num_finished_++;
1225#else
1226 // can't wait here for anything, so make a future to do the waiting
1227 num_running_++;
1228 auto future = RunTaskFuture();
1229 future.Wait();
1230#endif
1231 }
1232
1233 Status WaitForRunning(int count) {
1234#ifdef ARROW_ENABLE_THREADING

Callers 1

TaskMethod · 0.95

Calls 3

to_stringFunction · 0.85
InvalidFunction · 0.50
WaitMethod · 0.45

Tested by

no test coverage detected