I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit ec6e9b1b authored by zzz's avatar zzz
Browse files

Router: Hopefully fix clock/job queue deadlock after clock shift

parent ca6046f8
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment