Changeset 5030a86


Ignore:
Timestamp:
Sep 6, 2011 12:12:43 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
fdc3af9
Parents:
3d5beec
Message:

field cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/stat/Rate.java

    r3d5beec r5030a86  
    1515 */
    1616public class Rate {
    17     private final static Log _log = new Log(Rate.class);
     17    //private final static Log _log = new Log(Rate.class);
    1818    private volatile double _currentTotalValue;
    1919    private volatile long _currentEventCount;
     
    3636
    3737    /** locked during coalesce and addData */
    38     private final Object _lock = new Object();
     38    // private final Object _lock = new Object();
    3939
    4040    /** in the current (partial) period, what is the total value acrued through all events? */
     
    158158     */
    159159    public void addData(long value) {
    160         synchronized (_lock) {
     160        synchronized (this) {
    161161            _currentTotalValue += value;
    162162            _currentEventCount++;
     
    200200     */
    201201    public void addData(long value, long eventDuration) {
    202         synchronized (_lock) {
     202        synchronized (this) {
    203203            _currentTotalValue += value;
    204204            _currentEventCount++;
     
    216216        long now = now();
    217217        double correctedTotalValue; // for summaryListener which divides by rounded EventCount
    218         synchronized (_lock) {
     218        synchronized (this) {
    219219            long measuredPeriod = now - _lastCoalesceDate;
    220220            if (measuredPeriod < _period - SLACK) {
Note: See TracChangeset for help on using the changeset viewer.