]>
git.proxmox.com Git - ceph.git/blob - ceph/src/crimson/thread/Throttle.cc
3 namespace ceph::thread
{
5 int64_t Throttle::take(int64_t c
)
14 int64_t Throttle::put(int64_t c
)
22 on_free_slots
.signal();
27 seastar::future
<> Throttle::get(size_t c
)
30 return seastar::now();
32 return on_free_slots
.wait([this, c
] {
33 return !_should_wait(c
);
36 return seastar::now();
40 void Throttle::reset_max(size_t m
) {
46 on_free_slots
.signal();
51 bool Throttle::_should_wait(size_t c
) const {
55 return ((c
<= max
&& count
+ c
> max
) || // normally stay under max
56 (c
>= max
&& count
> max
)); // except for large c
59 } // namespace ceph::thread::seastar