if the job's startAfter is changed, tell the jobQueue to go through the timed jobs again in case the new time changes the scheduling

This commit is contained in:
jrandom
2004-07-10 01:44:27 +00:00
committed by zzz
parent b648fa2b70
commit 294cb96107
2 changed files with 15 additions and 1 deletions

View File

@ -189,6 +189,12 @@ public class JobQueue {
return;
}
public void timingUpdated() {
synchronized (_timedJobs) {
_timedJobs.notifyAll();
}
}
public int getReadyCount() {
synchronized (_readyJobs) {
return _readyJobs.size();

View File

@ -33,7 +33,15 @@ public class JobTiming implements Clock.ClockUpdateListener {
*
*/
public long getStartAfter() { return _start; }
public void setStartAfter(long startTime) { _start = startTime; }
public void setStartAfter(long startTime) {
_start = startTime;
// sure, this current job object may not already be on the queue, so
// telling the queue of the update may be irrelevent...
// but...
// ...
// who cares? this helps in the case where it is on the queue
_context.jobQueue().timingUpdated();
}
/**
* # of milliseconds after the epoch the job actually started