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

Comparing jsr166/src/jdk7/java/util/concurrent/Executor.java (file contents):
Revision 1.3 by jsr166, Tue Feb 5 19:54:07 2013 UTC vs.
Revision 1.6 by jsr166, Mon Feb 16 17:43:05 2015 UTC

# Line 12 | Line 12 | package java.util.concurrent;
12   * mechanics of how each task will be run, including details of thread
13   * use, scheduling, etc.  An {@code Executor} is normally used
14   * instead of explicitly creating threads. For example, rather than
15 < * invoking {@code new Thread(new(RunnableTask())).start()} for each
15 > * invoking {@code new Thread(new RunnableTask()).start()} for each
16   * of a set of tasks, you might use:
17   *
18   * <pre>
# Line 52 | Line 52 | package java.util.concurrent;
52   *
53   *  <pre> {@code
54   * class SerialExecutor implements Executor {
55 < *   final Queue<Runnable> tasks = new ArrayDeque<Runnable>();
55 > *   final Queue<Runnable> tasks = new ArrayDeque<>();
56   *   final Executor executor;
57   *   Runnable active;
58   *
# Line 61 | Line 61 | package java.util.concurrent;
61   *   }
62   *
63   *   public synchronized void execute(final Runnable r) {
64 < *     tasks.offer(new Runnable() {
64 > *     tasks.add(new Runnable() {
65   *       public void run() {
66   *         try {
67   *           r.run();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines