--- jsr166/src/jsr166e/ForkJoinPool.java 2012/08/13 15:52:33 1.1 +++ jsr166/src/jsr166e/ForkJoinPool.java 2012/10/21 06:40:20 1.6 @@ -1047,6 +1047,7 @@ public class ForkJoinPool extends Abstra ASHIFT = 31 - Integer.numberOfLeadingZeros(s); } } + /** * Per-thread records for threads that submit to pools. Currently * holds only pseudo-random seed / index that is used to choose @@ -1103,7 +1104,7 @@ public class ForkJoinPool extends Abstra private static final RuntimePermission modifyThreadPermission; /** - * Per-thread submission bookeeping. Shared across all pools + * Per-thread submission bookkeeping. Shared across all pools * to reduce ThreadLocal pollution and because random motion * to avoid contention in one pool is likely to hold for others. */ @@ -1300,14 +1301,13 @@ public class ForkJoinPool extends Abstra * * @param w the worker's queue */ - final void registerWorker(WorkQueue w) { Mutex lock = this.lock; lock.lock(); try { WorkQueue[] ws = workQueues; if (w != null && ws != null) { // skip on shutdown/failure - int rs, n = ws.length, m = n - 1; + int rs, n = ws.length, m = n - 1; int s = nextSeed += SEED_INCREMENT; // rarely-colliding sequence w.seed = (s == 0) ? 1 : s; // ensure non-zero seed int r = (s << 1) | 1; // use odd-numbered indices @@ -1518,7 +1518,7 @@ public class ForkJoinPool extends Abstra * awaiting signal, * * @param w the worker (via its WorkQueue) - * @return a task or null of none found + * @return a task or null if none found */ private final ForkJoinTask scan(WorkQueue w) { WorkQueue[] ws; // first update random seed