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.51 by dl, Fri Jul 23 16:49:11 2010 UTC vs.
Revision 1.52 by dl, Sat Jul 24 20:28:18 2010 UTC

# Line 280 | Line 280 | public abstract class ForkJoinTask<V> im
280       */
281      private int doJoin() {
282          int stat;
283 <        if ((stat = status) < 0)
284 <            return stat;
285 <        Thread t = Thread.currentThread();
283 >        Thread t;
284          ForkJoinWorkerThread w;
285 <        if (t instanceof ForkJoinWorkerThread) {
285 >        if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
286 >            if ((stat = status) < 0)
287 >                return stat;
288              if ((w = (ForkJoinWorkerThread) t).unpushTask(this)) {
289                  boolean completed;
290                  try {
# Line 536 | Line 536 | public abstract class ForkJoinTask<V> im
536      }
537  
538      /**
539 <     * Cancels, ignoring any exceptions it throws. Used during worker
540 <     * and pool shutdown.
539 >     * Cancels, ignoring any exceptions thrown by cancel. Used during
540 >     * worker and pool shutdown. Cancel is spec'ed not to throw any
541 >     * exceptions, but if it does anyway, we have no recourse during
542 >     * shutdown, so guard against this case.
543       */
544      final void cancelIgnoringExceptions() {
545          try {
# Line 671 | Line 673 | public abstract class ForkJoinTask<V> im
673          else
674              pool = null;
675          /*
676 <         * Timed wait loop intermixes cases for fj (pool != null) and
676 >         * Timed wait loop intermixes cases for FJ (pool != null) and
677           * non FJ threads. For FJ, decrement pool count but don't try
678           * for replacement; increment count on completion. For non-FJ,
679           * deal with interrupts. This is messy, but a little less so
# Line 687 | Line 689 | public abstract class ForkJoinTask<V> im
689              int s = status;
690              if (s < 0)
691                  break;
692 <            if (UNSAFE.compareAndSwapInt(this, statusOffset,
691 <                                         s, s | SIGNAL)) {
692 >            if (UNSAFE.compareAndSwapInt(this, statusOffset, s, SIGNAL)) {
693                  long startTime = System.nanoTime();
694                  long nanos = unit.toNanos(timeout);
695                  long nt; // wait time

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines