Changeset 835ed6d


Ignore:
Timestamp:
Sep 10, 2012 5:25:00 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
e0fc642
Parents:
37819286
Message:

boost priority of shutdown thread

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

Legend:

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

    r37819286 r835ed6d  
    767767     */
    768768    public void shutdown2(int exitCode) {
     769        // help us shut down esp. after OOM
     770        int priority = (exitCode == EXIT_OOM) ? Thread.MAX_PRIORITY - 1 : Thread.NORM_PRIORITY + 2;
     771        Thread.currentThread().setPriority(priority);
    769772        _shutdownInProgress = true;
    770773        _log.log(Log.CRIT, "Starting final shutdown(" + exitCode + ')');
  • router/java/src/net/i2p/router/tasks/OOMListener.java

    r37819286 r835ed6d  
    1919
    2020    public void outOfMemory(OutOfMemoryError oom) {
     21        // boost priority to help us shut down
     22        Thread.currentThread().setPriority(Thread.MAX_PRIORITY - 1);
    2123        Router.clearCaches();
    2224        Log log = _context.logManager().getLog(Router.class);
Note: See TracChangeset for help on using the changeset viewer.