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

Comparing jsr166/src/jsr166y/ForkJoinWorkerThread.java (file contents):
Revision 1.44 by jsr166, Wed Sep 1 20:15:43 2010 UTC vs.
Revision 1.45 by jsr166, Sat Sep 4 00:08:04 2010 UTC

# Line 313 | Line 313 | public class ForkJoinWorkerThread extend
313      }
314  
315      /**
316 <     * Performs additional initialization and starts this thread
316 >     * Performs additional initialization and starts this thread.
317       */
318      final void start(int poolIndex, UncaughtExceptionHandler ueh) {
319          this.poolIndex = poolIndex;
# Line 416 | Line 416 | public class ForkJoinWorkerThread extend
416      // helpers for run()
417  
418      /**
419 <     * Find and execute tasks and check status while running
419 >     * Finds and executes tasks, and checks status while running.
420       */
421      private void mainLoop() {
422          boolean ran = false; // true if ran a task on last step
# Line 430 | Line 430 | public class ForkJoinWorkerThread extend
430      }
431  
432      /**
433 <     * Try to steal a task and execute it
433 >     * Tries to steal a task and execute it.
434       *
435       * @return true if ran a task
436       */
# Line 517 | Line 517 | public class ForkJoinWorkerThread extend
517       * range. This method is used only during resets and backouts.
518       */
519      private static final void writeSlot(ForkJoinTask<?>[] q, int i,
520 <                                              ForkJoinTask<?> t) {
520 >                                        ForkJoinTask<?> t) {
521          UNSAFE.putObjectVolatile(q, (i << qShift) + qBase, t);
522      }
523  
# Line 628 | Line 628 | public class ForkJoinWorkerThread extend
628      }
629  
630      /**
631 <     * Returns next task or null if empty or contended
631 >     * Returns next task, or null if empty or contended.
632       */
633      final ForkJoinTask<?> peekTask() {
634          ForkJoinTask<?>[] q = queue;
# Line 670 | Line 670 | public class ForkJoinWorkerThread extend
670       * Computes next value for random victim probe in scan().  Scans
671       * don't require a very high quality generator, but also not a
672       * crummy one.  Marsaglia xor-shift is cheap and works well enough.
673 <     * Note: This is manually inlined in scan()
673 >     * Note: This is manually inlined in scan().
674       */
675      private static final int xorShift(int r) {
676          r ^= r << 13;
# Line 776 | Line 776 | public class ForkJoinWorkerThread extend
776      }
777  
778      /**
779 <     * Sets state to TERMINATED. Called only by onTermination()
779 >     * Sets state to TERMINATED. Called only by onTermination().
780       */
781      private void setTerminated() {
782          int s;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines