forked from I2P_Developers/i2p.i2p
Router: Hopefully fix clock/job queue deadlock after clock shift
ref: http://git.idk.i2p/mesh/i2p.i2p/-/issues/6
This commit is contained in:
@@ -50,7 +50,21 @@ public abstract class JobImpl implements Job {
|
||||
public Exception getAddedBy() { return null; }
|
||||
|
||||
public long getMadeReadyOn() { return _madeReadyOn; }
|
||||
|
||||
/**
|
||||
* Deprecated to avoid JobQueue deadlocks
|
||||
* @deprecated use madeReady(long)
|
||||
*/
|
||||
@Deprecated
|
||||
public void madeReady() { _madeReadyOn = _context.clock().now(); }
|
||||
|
||||
/**
|
||||
* For JobQueue only, not for external use
|
||||
* @since 0.9.55
|
||||
*/
|
||||
public void madeReady(long now) { _madeReadyOn = now; }
|
||||
|
||||
|
||||
public void dropped() {}
|
||||
|
||||
/**
|
||||
|
||||
@@ -206,7 +206,7 @@ public class JobQueue {
|
||||
// don't skew us - its 'start after' its been queued, or later
|
||||
job.getTiming().setStartAfter(now);
|
||||
if (job instanceof JobImpl)
|
||||
((JobImpl)job).madeReady();
|
||||
((JobImpl)job).madeReady(now);
|
||||
_readyJobs.offer(job);
|
||||
} else {
|
||||
_timedJobs.add(job);
|
||||
@@ -559,7 +559,7 @@ public class JobQueue {
|
||||
lastTime = lastJob.getTiming().getStartAfter();
|
||||
if (timeLeft <= 0) {
|
||||
if (j instanceof JobImpl)
|
||||
((JobImpl)j).madeReady();
|
||||
((JobImpl)j).madeReady(now);
|
||||
|
||||
_readyJobs.offer(j);
|
||||
iter.remove();
|
||||
|
||||
Reference in New Issue
Block a user