Signed-off-by: Haomai Wang <haomai@xsky.com>
return count.read();
}
+void Throttle::reset()
+{
+ Mutex::Locker l(lock);
+ if (!cond.empty())
+ cond.front()->SignalOne();
+ count.set(0);
+ if (logger) {
+ logger->set(l_throttle_val, 0);
+ }
+}
+
bool BackoffThrottle::set_params(
double _low_threshhold,
double _high_threshhold,
* @returns number of requests being hold after this
*/
int64_t put(int64_t c = 1);
+ /**
+ * reset the zero to the stock
+ */
+ void reset();
+
bool should_wait(int64_t c) const {
return _should_wait(c);
}