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

Method TryAcquire

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

Source from the content-addressed store, hash-verified

375class CustomThrottle : public ThrottledAsyncTaskScheduler::Throttle {
376 public:
377 virtual std::optional<Future<>> TryAcquire(int amt) {
378 if (gate_.is_finished()) {
379 return std::nullopt;
380 } else {
381 return gate_;
382 }
383 }
384 virtual void Release(int amt) {}
385 void Unlock() { gate_.MarkFinished(); }
386 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