MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ScopedReservation

Class ScopedReservation

tensorflow/compiler/xla/python/semaphore.h:35–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 void Release(int64 amount);
34
35 class ScopedReservation {
36 public:
37 ScopedReservation(Semaphore* semaphore, int64 amount)
38 : semaphore_(semaphore), amount_(amount) {}
39 ~ScopedReservation();
40
41 ScopedReservation(const ScopedReservation&) = delete;
42 ScopedReservation(ScopedReservation&& other) noexcept;
43 ScopedReservation& operator=(const ScopedReservation&) = delete;
44 ScopedReservation& operator=(ScopedReservation&& other) noexcept;
45
46 private:
47 Semaphore* semaphore_;
48 int64 amount_;
49 };
50 // RAII version of Acquire. Releases the reservation when the
51 // ScopedReservation is destroyed.
52 ScopedReservation ScopedAcquire(int64 amount);

Callers 1

ScopedAcquireMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected