forked from I2P_Developers/i2p.i2p
#1069: Deprecated SimpleScheduler and moved functionality into SimpleTimer2
This commit is contained in:
@ -5,8 +5,8 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import net.i2p.data.Hash;
|
||||
import net.i2p.util.ObjectCounter;
|
||||
import net.i2p.util.RandomSource;
|
||||
import net.i2p.util.SimpleScheduler;
|
||||
import net.i2p.util.SimpleTimer;
|
||||
import net.i2p.util.SimpleTimer2;
|
||||
|
||||
/**
|
||||
* Count how often we have received an incoming connection
|
||||
@ -33,7 +33,7 @@ class ConnThrottler {
|
||||
// shorten the initial period by a random amount
|
||||
// to prevent correlation across destinations
|
||||
// and identification of router startup time
|
||||
SimpleScheduler.getInstance().addPeriodicEvent(new Cleaner(),
|
||||
SimpleTimer2.getInstance().addPeriodicEvent(new Cleaner(),
|
||||
(period / 2) + RandomSource.getInstance().nextLong(period / 2),
|
||||
period);
|
||||
}
|
||||
|
@ -781,7 +781,7 @@ class Connection {
|
||||
private boolean scheduleDisconnectEvent() {
|
||||
if (!_disconnectScheduledOn.compareAndSet(0, _context.clock().now()))
|
||||
return false;
|
||||
_context.simpleScheduler().addEvent(new DisconnectEvent(), DISCONNECT_TIMEOUT);
|
||||
_context.simpleTimer2().addEvent(new DisconnectEvent(), DISCONNECT_TIMEOUT);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ class ConnectionPacketHandler {
|
||||
final long delay = nextSendTime - now;
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("scheduling ack in "+delay);
|
||||
_context.simpleScheduler().addEvent(new AckDup(con), delay);
|
||||
_context.simpleTimer2().addEvent(new AckDup(con), delay);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -16,7 +16,7 @@ abstract class SchedulerImpl implements TaskScheduler {
|
||||
}
|
||||
|
||||
protected void reschedule(long msToWait, Connection con) {
|
||||
_context.simpleScheduler().addEvent(con.getConnectionEvent(), msToWait);
|
||||
_context.simpleTimer2().addEvent(con.getConnectionEvent(), msToWait);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user