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

Comparing jsr166/src/main/java/util/concurrent/ExecutorService.java (file contents):
Revision 1.52 by jsr166, Wed Jun 8 00:50:35 2011 UTC vs.
Revision 1.53 by jsr166, Thu Jun 9 07:48:43 2011 UTC

# Line 42 | Line 42 | import java.util.Collection;
42   * pool service incoming requests. It uses the preconfigured {@link
43   * Executors#newFixedThreadPool} factory method:
44   *
45 < * <pre>
45 > *  <pre> {@code
46   * class NetworkService implements Runnable {
47   *   private final ServerSocket serverSocket;
48   *   private final ExecutorService pool;
# Line 70 | Line 70 | import java.util.Collection;
70   *   public void run() {
71   *     // read and service request on socket
72   *   }
73 < * }
74 < * </pre>
73 > * }}</pre>
74   *
75   * The following method shuts down an <tt>ExecutorService</tt> in two phases,
76   * first by calling <tt>shutdown</tt> to reject incoming tasks, and then
77   * calling <tt>shutdownNow</tt>, if necessary, to cancel any lingering tasks:
78   *
79 < * <pre>
79 > *  <pre> {@code
80   * void shutdownAndAwaitTermination(ExecutorService pool) {
81   *   pool.shutdown(); // Disable new tasks from being submitted
82   *   try {
# Line 94 | Line 93 | import java.util.Collection;
93   *     // Preserve interrupt status
94   *     Thread.currentThread().interrupt();
95   *   }
96 < * }
98 < * </pre>
96 > * }}</pre>
97   *
98   * <p>Memory consistency effects: Actions in a thread prior to the
99   * submission of a {@code Runnable} or {@code Callable} task to an

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines