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

Comparing jsr166/src/main/java/util/concurrent/ForkJoinWorkerThread.java (file contents):
Revision 1.24 by dl, Thu Sep 2 11:31:22 2010 UTC vs.
Revision 1.25 by jsr166, Sat Sep 4 00:08:04 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines