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

Method TryAcquire

cpp/src/arrow/util/async_util_test.cc:350–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348class CustomThrottle : public ThrottledAsyncTaskScheduler::Throttle {
349 public:
350 virtual std::optional<Future<>> TryAcquire(int amt) {
351 if (gate_.is_finished()) {
352 return std::nullopt;
353 } else {
354 return gate_;
355 }
356 }
357 virtual void Release(int amt) {}
358 void Unlock() { gate_.MarkFinished(); }
359 int Capacity() { return std::numeric_limits<int>::max(); }

Callers

nothing calls this directly

Calls 1

is_finishedMethod · 0.45

Tested by

no test coverage detected