java.lang.Object
net.i2p.router.JobQueue.QueuePumper
- All Implemented Interfaces:
Runnable, RouterClock.ClockShiftListener, Clock.ClockUpdateListener
- Enclosing class:
JobQueue
private final class JobQueue.QueuePumperextends Object implements Runnable, Clock.ClockUpdateListener, RouterClock.ClockShiftListener
Thread pumping the ready jobs to the runners.
Field Summary
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionvoidclockShift(long delta) Handle a clock shift event.voidoffsetChanged(long delta) Handle a clock offset change.voidrun()Pump jobs from the scheduling queue to the runner queue.
Field Details
_toMove
Constructor Details
QueuePumper
public QueuePumper()Builds the queue pumper thread.
Method Details
run
public void run()Pump jobs from the scheduling queue to the runner queue.The iteration and removal of _timedJobs happens outside the lock because ConcurrentSkipListSet supports safe concurrent iteration. Only the wait/notify signaling needs _jobLock, reducing contention with addJob() which must also acquire _jobLock.
offsetChanged
public void offsetChanged(long delta) Handle a clock offset change.- Specified by:
offsetChangedin interfaceClock.ClockUpdateListener- Parameters:
delta- = (new offset - old offset), where each offset = (now() -System.currentTimeMillis())
clockShift
public void clockShift(long delta) Handle a clock shift event.- Specified by:
clockShiftin interfaceRouterClock.ClockShiftListener- Parameters:
delta- The system clock and adjusted clock just changed by this much, in milliseconds (approximately)