Changeset e664423


Ignore:
Timestamp:
Nov 13, 2015 11:28:02 PM (5 years ago)
Author:
zab2 <zab2@…>
Branches:
master
Children:
7a75e2e6
Parents:
8a1f02aa
Message:

Interrupt when cancelling events

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/util/SimpleTimer2.java

    r8a1f02aa re664423  
    397397                // The result (if rescheduled) is a dup on the queue, see tickets 1694, 1705
    398398                // Mitigated by close-to-execution check in reschedule()
    399                 boolean cancelled = _future.cancel(false);
     399                boolean cancelled = _future.cancel(true);
    400400                if (cancelled)
    401401                    _state = TimedEventState.CANCELLED;
     
    423423            long delay = 0;
    424424            synchronized(this) {
     425                if (Thread.currentThread().isInterrupted()) {
     426                    _log.warn("I was interrupted in run, state "+_state+" event "+this);
     427                    return;
     428                }
    425429                if (_rescheduleAfterRun)
    426430                    throw new IllegalStateException(this + " rescheduleAfterRun cannot be true here");
Note: See TracChangeset for help on using the changeset viewer.