Changeset 0c5b4c0


Ignore:
Timestamp:
Sep 6, 2012 7:25:31 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3347788
Parents:
b8949ea
Message:

minor cleanups

Location:
router/java/src/net/i2p/router/tunnel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java

    rb8949ea r0c5b4c0  
    810810******/
    811811
    812     public void startup() {
     812    public synchronized void startup() {
    813813        // Note that we only use the validator for participants and OBEPs, not IBGWs, so
    814814        // this BW estimate will be high by about 33% assuming 2-hop tunnels average
     
    824824    }
    825825
    826     public void shutdown() {
     826    public synchronized void shutdown() {
    827827        if (_validator != null)
    828828            _validator.destroy();
     
    834834        _inboundGateways.clear();
    835835        _participatingConfig.clear();
     836        _leaveJob.clear();
    836837    }
    837838
     
    866867        public void add(HopConfig cfg) {
    867868            _configs.offer(cfg);
     869        }
     870
     871        public void clear() {
     872            _configs.clear();
    868873        }
    869874       
  • router/java/src/net/i2p/router/tunnel/TunnelGateway.java

    rb8949ea r0c5b4c0  
    5555     *                 to the first hop
    5656     */
    57     public TunnelGateway(RouterContext context, QueuePreprocessor preprocessor, Sender sender, Receiver receiver) {
     57    protected TunnelGateway(RouterContext context, QueuePreprocessor preprocessor, Sender sender, Receiver receiver) {
    5858        _context = context;
    5959        _log = context.logManager().getLog(getClass());
     
    193193        public void timeReached() {
    194194            boolean wantRequeue = false;
    195             int remaining = 0;
    196             long beforeLock = _context.clock().now();
    197             long afterChecked = -1;
     195            //int remaining = 0;
     196            //long beforeLock = _context.clock().now();
     197            //long afterChecked = -1;
    198198            long delayAmount = -1;
    199199            //if (_queue.size() > 10000) // stay out of the synchronized block
     
    202202                //if (_queue.size() > 10000) // stay in the synchronized block
    203203                //    System.out.println("foo!");
    204                 afterChecked = _context.clock().now();
     204                //afterChecked = _context.clock().now();
    205205                if (!_queue.isEmpty()) {
    206                     if ( (remaining > 0) && (_log.shouldLog(Log.DEBUG)) )
    207                         _log.debug("Remaining before delayed flush preprocessing: " + _queue);
     206                    //if ( (remaining > 0) && (_log.shouldLog(Log.DEBUG)) )
     207                    //    _log.debug("Remaining before delayed flush preprocessing: " + _queue);
    208208                    wantRequeue = _preprocessor.preprocessQueue(_queue, _sender, _receiver);
    209                     if (wantRequeue)
     209                    if (wantRequeue) {
    210210                        delayAmount = _preprocessor.getDelayAmount();
    211                     if (_log.shouldLog(Log.DEBUG))
    212                         _log.debug("Remaining after delayed flush preprocessing (requeue? " + wantRequeue + "): " + _queue);
     211                        if (_log.shouldLog(Log.DEBUG))
     212                            _log.debug("Remaining after delayed flush preprocessing: " + _queue);
     213                    }
    213214                }
    214                 remaining = _queue.size();
     215                //remaining = _queue.size();
    215216            }
    216217           
Note: See TracChangeset for help on using the changeset viewer.