diff options
| author | pjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-11-25 19:35:39 +0000 |
|---|---|---|
| committer | pjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-11-25 19:35:39 +0000 |
| commit | 26b47a583975a1b564bb2b59d6dee28efa953f8e (patch) | |
| tree | 239ebc5fffc1564da6da45845468c1cc03fbf42d /java/src/TimerQueue.java | |
| parent | 1d69ca579168f2b571b98edd67cf93aa2ce42245 (diff) | |
| download | ATCD-26b47a583975a1b564bb2b59d6dee28efa953f8e.tar.gz | |
Cleaned up the code a little bit
Diffstat (limited to 'java/src/TimerQueue.java')
| -rw-r--r-- | java/src/TimerQueue.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/java/src/TimerQueue.java b/java/src/TimerQueue.java index 0aed48a84ae..1560332f5b3 100644 --- a/java/src/TimerQueue.java +++ b/java/src/TimerQueue.java @@ -112,7 +112,6 @@ public class TimerQueue implements Runnable timeout = new TimeValue (); try { - // System.out.println (timeout); // Extract the earliest time from the queue and do a timed wait this.obj_.timedWait (timeout); @@ -214,10 +213,9 @@ public class TimerQueue implements Runnable { if (this.isEmpty () || futureTime.lessThan (this.earliestTime ())) { - // Place at the beginning of the list. + // Insert the node into (the beginning of) the queue to be + // scheduled. this.reschedule (node); - this.obj_.condition (true); - this.reset_ = true; // Notify the waiting thread so that it can reschedule // using the earliest timeout @@ -342,6 +340,10 @@ public class TimerQueue implements Runnable { expired.next_ = this.head_; this.head_ = expired; + // Set the condition to true so that the waiting thread can be + // notified and it can reschedule. + this.obj_.condition (true); + this.reset_ = true; } else { |
