jdk/src/share/classes/java/util/concurrent/Future.java
changeset 14325 622c473a21aa
parent 9242 ef138d47df58
child 18790 d25399d849bc
equal deleted inserted replaced
14324:3510b4bf90ee 14325:622c473a21aa
    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  *