ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ScheduledThreadPoolExecutor.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ScheduledThreadPoolExecutor.java (file contents):
Revision 1.1 by dl, Fri Dec 5 11:27:02 2003 UTC vs.
Revision 1.2 by dl, Fri Dec 5 11:57:52 2003 UTC

# Line 135 | Line 135 | public class ScheduledThreadPoolExecutor
135          }
136  
137          /**
138 <         * Overrides FutureTask version so as to not setDone if
139 <         * periodic.
138 >         * Overrides FutureTask version so as to reset if periodic.
139           */
140          public void run() {
141 <            if (setRunning()) {
142 <                try {
143 <                    try {
144 <                        if (runnable != null)
146 <                            runnable.run();
147 <                        else if (callable != null)
148 <                            set(callable.call());
149 <                    } catch(Throwable ex) {
150 <                        setException(ex);
151 <                    }
152 <                } finally {
153 <                    if (!isPeriodic())
154 <                        setDone();
155 <                }
156 <            }
141 >            if (isPeriodic())
142 >                runAndReset();
143 >            else
144 >                super.run();
145          }
146  
147          /**
# Line 561 | Line 549 | public class ScheduledThreadPoolExecutor
549          Object[] entries = super.getQueue().toArray();
550          for (int i = 0; i < entries.length; ++i) {
551              ScheduledFutureTask<?> t = (ScheduledFutureTask<?>)entries[i];
552 <            Runnable r = t.runnable;
552 >            Object r = t.getTask();
553              if (task.equals(r)) {
554                  wrap = t;
555                  break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines