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.23 by jsr166, Wed Sep 1 20:15:43 2010 UTC vs.
Revision 1.24 by dl, Thu Sep 2 11:31:22 2010 UTC

# Line 170 | Line 170 | public class ForkJoinWorkerThread extend
170  
171      /**
172       * Maximum work-stealing queue array size.  Must be less than or
173 <     * equal to 1 << 28 to ensure lack of index wraparound. (This
174 <     * is less than usual bounds, because we need leftshift by 3
175 <     * to be in int range).
173 >     * equal to 1 << (31 - width of array entry) to ensure lack of
174 >     * index wraparound. The value is set in the static block
175 >     * at the end of this file after obtaining width.
176       */
177 <    private static final int MAXIMUM_QUEUE_CAPACITY = 1 << 28;
177 >    private static final int MAXIMUM_QUEUE_CAPACITY;
178  
179      /**
180       * The pool this thread works in. Accessed directly by ForkJoinTask.
# Line 1159 | Line 1159 | public class ForkJoinWorkerThread extend
1159          if ((s & (s-1)) != 0)
1160              throw new Error("data type scale not a power of two");
1161          qShift = 31 - Integer.numberOfLeadingZeros(s);
1162 +        MAXIMUM_QUEUE_CAPACITY = 1 << (31 - qShift);
1163      }
1164  
1165      private static long objectFieldOffset(String field, Class<?> klazz) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines