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++;
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() {
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;
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();
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);