equal
deleted
inserted
replaced
74 * |
74 * |
75 * The {@link FutureTask} class is an implementation of <tt>Future</tt> that |
75 * The {@link FutureTask} class is an implementation of <tt>Future</tt> that |
76 * implements <tt>Runnable</tt>, and so may be executed by an <tt>Executor</tt>. |
76 * implements <tt>Runnable</tt>, and so may be executed by an <tt>Executor</tt>. |
77 * For example, the above construction with <tt>submit</tt> could be replaced by: |
77 * For example, the above construction with <tt>submit</tt> could be replaced by: |
78 * <pre> {@code |
78 * <pre> {@code |
79 * FutureTask<String> future = |
79 * FutureTask<String> future = |
80 * new FutureTask<String>(new Callable<String>() { |
80 * new FutureTask<String>(new Callable<String>() { |
81 * public String call() { |
81 * public String call() { |
82 * return searcher.search(target); |
82 * return searcher.search(target); |
83 * }}); |
83 * }}); |
84 * executor.execute(future);}</pre> |
84 * executor.execute(future);}</pre> |
85 * |
85 * |
86 * <p>Memory consistency effects: Actions taken by the asynchronous computation |
86 * <p>Memory consistency effects: Actions taken by the asynchronous computation |
87 * <a href="package-summary.html#MemoryVisibility"> <i>happen-before</i></a> |
87 * <a href="package-summary.html#MemoryVisibility"> <i>happen-before</i></a> |
88 * actions following the corresponding {@code Future.get()} in another thread. |
88 * actions following the corresponding {@code Future.get()} in another thread. |
89 * |
89 * |