ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/ForkJoinTask.java
(Generate patch)

Comparing jsr166/src/jsr166y/ForkJoinTask.java (file contents):
Revision 1.18 by dl, Sat Jul 25 15:50:57 2009 UTC vs.
Revision 1.21 by jsr166, Sun Jul 26 06:26:37 2009 UTC

# Line 493 | Line 493 | public abstract class ForkJoinTask<V> im
493       * #inForkJoinPool}). Attempts to invoke in other contexts result
494       * in exceptions or errors, possibly including ClassCastException.
495       *
496 <     * @return <code>this</code>, to simplify usage.
496 >     * @return {@code this}, to simplify usage.
497       */
498      public final ForkJoinTask<V> fork() {
499          ((ForkJoinWorkerThread) Thread.currentThread())
# Line 606 | Line 606 | public abstract class ForkJoinTask<V> im
606       * in exceptions or errors, possibly including ClassCastException.
607       *
608       * @param tasks the collection of tasks
609 +     * @return the tasks argument, to simplify usage
610       * @throws NullPointerException if tasks or any element are null
611       * @throws RuntimeException or Error if any task did so
612       */
613 <    public static void invokeAll(Collection<? extends ForkJoinTask<?>> tasks) {
613 >    public static <T extends ForkJoinTask<?>> Collection<T> invokeAll(Collection<T> tasks) {
614          if (!(tasks instanceof List<?>)) {
615              invokeAll(tasks.toArray(new ForkJoinTask<?>[tasks.size()]));
616 <            return;
616 >            return tasks;
617          }
618          @SuppressWarnings("unchecked")
619          List<? extends ForkJoinTask<?>> ts =
# Line 647 | Line 648 | public abstract class ForkJoinTask<V> im
648          }
649          if (ex != null)
650              rethrowException(ex);
651 +        return tasks;
652      }
653  
654      /**
# Line 1040 | Line 1042 | public abstract class ForkJoinTask<V> im
1042      // adaptors
1043  
1044      /**
1045 <     * Returns a new ForkJoinTask that performs the <code>run</code>
1045 >     * Returns a new ForkJoinTask that performs the {@code run}
1046       * method of the given Runnable as its action, and returns a null
1047 <     * result upon <code>join</code>.
1047 >     * result upon {@code join}.
1048       *
1049       * @param runnable the runnable action
1050       * @return the task
# Line 1052 | Line 1054 | public abstract class ForkJoinTask<V> im
1054      }
1055  
1056      /**
1057 <     * Returns a new ForkJoinTask that performs the <code>run</code>
1057 >     * Returns a new ForkJoinTask that performs the {@code run}
1058       * method of the given Runnable as its action, and returns the
1059 <     * given result upon <code>join</code>.
1059 >     * given result upon {@code join}.
1060       *
1061       * @param runnable the runnable action
1062       * @param result the result upon completion
# Line 1065 | Line 1067 | public abstract class ForkJoinTask<V> im
1067      }
1068  
1069      /**
1070 <     * Returns a new ForkJoinTask that performs the <code>call</code>
1070 >     * Returns a new ForkJoinTask that performs the {@code call}
1071       * method of the given Callable as its action, and returns its
1072 <     * result upon <code>join</code>, translating any checked
1073 <     * exceptions encountered into <code>RuntimeException<code>.
1072 >     * result upon {@code join}, translating any checked
1073 >     * exceptions encountered into {@code RuntimeException}.
1074       *
1075       * @param callable the callable action
1076       * @return the task
# Line 1147 | Line 1149 | public abstract class ForkJoinTask<V> im
1149      }
1150  
1151      private static final sun.misc.Unsafe UNSAFE = getUnsafe();
1152 <    static final long statusOffset =
1152 >    private static final long statusOffset =
1153          fieldOffset("status", ForkJoinTask.class);
1154  
1155   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines