Changeset 0fa5fa4


Ignore:
Timestamp:
Jun 18, 2011 7:58:50 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
94e5aaf
Parents:
4caf48b
Message:
  • Shutdown:
    • More job queue cleanups
    • RouterInfo? readin job checks for quick shutdown
    • Note that we should improve profile read job
Location:
router/java/src/net/i2p/router
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/JobQueue.java

    r4caf48b r0fa5fa4  
    281281    void shutdown() {
    282282        _alive = false;
    283         _timedJobs.clear();
    284         _readyJobs.clear();
     283        synchronized (_jobLock) {
     284            _timedJobs.clear();
     285            _readyJobs.clear();
     286            _jobLock.notifyAll();
     287        }
    285288        // The JobQueueRunners are NOT daemons,
    286289        // so they must be stopped.
    287290        Job poison = new PoisonJob();
    288         for (int i = 0; i < _queueRunners.size(); i++)
     291        for (JobQueueRunner runner : _queueRunners.values()) {
     292             runner.stopRunning();
    289293            _readyJobs.offer(poison);
    290 
     294            // TODO interrupt thread for each runner
     295        }
     296        _queueRunners.clear();
     297        _jobStats.clear();
     298        _runnerId = 0;
    291299
    292300      /********
  • router/java/src/net/i2p/router/networkdb/kademlia/PersistentDataStore.java

    r4caf48b r0fa5fa4  
    360360                        _alreadyWarned = false;
    361361                    for (int i = 0; i < routerInfoFiles.length; i++) {
     362                        // drop out if the router gets killed right after startup
     363                        if (!_context.router().isAlive())
     364                            break;
    362365                        Hash key = getRouterInfoHash(routerInfoFiles[i].getName());
    363366                        if ( (key != null) && (!isKnown(key)) ) {
  • router/java/src/net/i2p/router/peermanager/PeerManager.java

    r4caf48b r0fa5fa4  
    118118
    119119    void loadProfiles() {
     120        // TODO do this in a Thread or a Job to not slow down the constructor
    120121        Set<PeerProfile> profiles = _persistenceHelper.readProfiles();
    121122        for (Iterator<PeerProfile> iter = profiles.iterator(); iter.hasNext();) {
Note: See TracChangeset for help on using the changeset viewer.