@@ -41,11 +41,11 @@ class ExportedStatMapImpl : public ExportedStatMap {
4141
4242 /*
4343 * Locks the timeseries object that is held by this LockableStat object
44- * and returns the LockedPtr for it. The histogram remains locked as long as
45- * the LockedPtr object remains in scope.
44+ * and returns the LockedStatPtr for it. The histogram remains locked as
45+ * long as the LockedStatPtr object remains in scope.
4646 */
4747 LockedStatPtr lock () const {
48- return stat_->lock ();
48+ return stat_->wlock ();
4949 }
5050
5151 /* Return true if the stat held by this object is null. */
@@ -70,7 +70,7 @@ class ExportedStatMapImpl : public ExportedStatMap {
7070 */
7171 void addValue (TimePoint now, const CounterType value, int64_t times = 1 )
7272 const {
73- stat_->lock ()->addValue (now, value, times);
73+ stat_->wlock ()->addValue (now, value, times);
7474 }
7575
7676 /*
@@ -81,15 +81,15 @@ class ExportedStatMapImpl : public ExportedStatMap {
8181 TimePoint now,
8282 const CounterType value,
8383 int64_t numSamples) const {
84- stat_->lock ()->addValueAggregated (now, value, numSamples);
84+ stat_->wlock ()->addValueAggregated (now, value, numSamples);
8585 }
8686
8787 /*
8888 * Add a value at time 'now' to all levels. The optional 'times' parameter
8989 * can be used here to add multiple copies of the value at a time.
9090 *
9191 * This method assumes that the object has already been locked, and requires
92- * the appropriate LockedPtr object as a parameter.
92+ * the appropriate LockedStatPtr object as a parameter.
9393 */
9494 void addValueLocked (
9595 const LockedStatPtr& lockedObj,
@@ -104,7 +104,7 @@ class ExportedStatMapImpl : public ExportedStatMap {
104104 * Update the histogram with the given time value.
105105 *
106106 * This method assumes that the object has already been locked, and requires
107- * the appropriate LockedPtr object as a parameter.
107+ * the appropriate LockedStatPtr object as a parameter.
108108 */
109109 void updateLocked (const LockedStatPtr& lockedObj, TimePoint now) {
110110 DCHECK (!lockedObj.isNull ());
@@ -115,7 +115,7 @@ class ExportedStatMapImpl : public ExportedStatMap {
115115 * Flush all cached updates.
116116 *
117117 * This method assumes that the object has already been locked, and requires
118- * the appropriate LockedPtr object as a parameter.
118+ * the appropriate LockedStatPtr object as a parameter.
119119 */
120120 void flushLocked (const LockedStatPtr& lockedObj) {
121121 DCHECK (!lockedObj.isNull ());
@@ -128,14 +128,14 @@ class ExportedStatMapImpl : public ExportedStatMap {
128128 */
129129 template <typename ReturnType>
130130 ReturnType rate (int level) {
131- return stat_->lock ()->rate <ReturnType>(level);
131+ return stat_->wlock ()->rate <ReturnType>(level);
132132 }
133133
134134 /*
135135 * Return the sum of all the data points currently tracked at this level.
136136 *
137137 * This method assumes that the object has already been locked, and requires
138- * the appropriate LockedPtr object as a parameter.
138+ * the appropriate LockedStatPtr object as a parameter.
139139 */
140140 CounterType getSumLocked (const LockedStatPtr& lockedObj, int level) {
141141 DCHECK (!lockedObj.isNull ());
@@ -217,7 +217,7 @@ class ExportedStatMapImpl : public ExportedStatMap {
217217 */
218218 void
219219 addValue (StatPtr& item, TimePoint now, CounterType value, int64_t times = 1 ) {
220- item->lock ()->addValue (now, value, times);
220+ item->wlock ()->addValue (now, value, times);
221221 }
222222
223223 using ExportedStatMap::addValueAggregated;
@@ -238,7 +238,7 @@ class ExportedStatMapImpl : public ExportedStatMap {
238238 TimePoint now,
239239 CounterType sum,
240240 int64_t nsamples) {
241- item->lock ()->addValueAggregated (now, sum, nsamples);
241+ item->wlock ()->addValueAggregated (now, sum, nsamples);
242242 }
243243
244244 using ExportedStatMap::exportStat;
0 commit comments