]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/Throttle.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / common / Throttle.h
index 1a6acac59d3cc48c417cd7c4dd7b9727a467cc1a..c6537650451e7f3b18ba7cab97c0debc44972b7a 100644 (file)
@@ -163,12 +163,12 @@ class BackoffThrottle {
   unsigned next_cond = 0;
 
   /// allocated once to avoid constantly allocating new ones
-  vector<std::condition_variable> conds;
+  std::vector<std::condition_variable> conds;
 
   const bool use_perf;
 
   /// pointers into conds
-  list<std::condition_variable*> waiters;
+  std::list<std::condition_variable*> waiters;
 
   std::list<std::condition_variable*>::iterator _push_waiter() {
     unsigned next = next_cond++;
@@ -215,7 +215,7 @@ public:
     double high_multiple,
     double max_multiple,
     uint64_t throttle_max,
-    ostream *errstream);
+    std::ostream *errstream);
 
   ceph::timespan get(uint64_t c = 1);
   ceph::timespan wait() {
@@ -362,10 +362,10 @@ class TokenBucketThrottle {
   uint64_t m_avg = 0;
   uint64_t m_burst = 0;
   SafeTimer *m_timer;
-  Mutex *m_timer_lock;
-  FunctionContext *m_token_ctx = nullptr;
-  list<Blocker> m_blockers;
-  Mutex m_lock;
+  ceph::mutex *m_timer_lock;
+  Context *m_token_ctx = nullptr;
+  std::list<Blocker> m_blockers;
+  ceph::mutex m_lock;
 
   // minimum of the filling period.
   uint64_t m_tick_min = 50;
@@ -409,7 +409,7 @@ class TokenBucketThrottle {
 public:
   TokenBucketThrottle(CephContext *cct, const std::string &name,
                       uint64_t capacity, uint64_t avg,
-                      SafeTimer *timer, Mutex *timer_lock);
+                      SafeTimer *timer, ceph::mutex *timer_lock);
 
   ~TokenBucketThrottle();
 
@@ -419,7 +419,7 @@ public:
 
   template <typename T, typename I, void(T::*MF)(int, I*, uint64_t)>
   void add_blocker(uint64_t c, T *handler, I *item, uint64_t flag) {
-    Context *ctx = new FunctionContext([handler, item, flag](int r) {
+    Context *ctx = new LambdaContext([handler, item, flag](int r) {
       (handler->*MF)(r, item, flag);
       });
     m_blockers.emplace_back(c, ctx);