Changeset de9d968


Ignore:
Timestamp:
Mar 27, 2019 12:32:23 PM (16 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
14492d72
Parents:
7bb76776
Message:

DatabaseEntry?: Change from volatile to synched

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/data/DatabaseEntry.java

    r7bb76776 rde9d968  
    6060
    6161    protected volatile Signature _signature;
    62     protected volatile Hash _currentRoutingKey;
    63     protected volatile long _routingKeyGenMod;
     62    // synch: this
     63    private Hash _currentRoutingKey;
     64    private long _routingKeyGenMod;
    6465
    6566    /**
     
    154155        RoutingKeyGenerator gen = ctx.routingKeyGenerator();
    155156        long mod = gen.getLastChanged();
    156         if (mod != _routingKeyGenMod) {
    157             _currentRoutingKey = gen.getRoutingKey(getHash());
    158             _routingKeyGenMod = mod;
     157        synchronized(this) {
     158            if (mod != _routingKeyGenMod) {
     159                _currentRoutingKey = gen.getRoutingKey(getHash());
     160                _routingKeyGenMod = mod;
     161            }
     162            return _currentRoutingKey;
    159163        }
    160         return _currentRoutingKey;
    161164    }
    162165
Note: See TracChangeset for help on using the changeset viewer.